Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Test login view redirect

Anna Siwikdaa071657921
diff --git a/saleor/registration/views.py b/saleor/registration/views.py
index 36e629b38f..7bc8556281 100644
--- a/saleor/registration/views.py
+++ b/saleor/registration/views.py
@@ -29,7 +29,6 @@ def logout(request):
def signup(request):
- import ipdb; ipdb.set_trace()
form = SignupForm(request.POST or None)
if form.is_valid():
form.save()
diff --git a/tests/test_registration.py b/tests/test_registration.py
index fd05a6aae3..8b688b5251 100644
--- a/tests/test_registration.py
+++ b/tests/test_registration.py
@@ -58,6 +58,16 @@ def test_login_view_next(client, customer_user):
assert redirect_location == '/cart/'
+def test_login_view_redirect(client, customer_user):
+ url = reverse('account_login')
+ data = {
+ 'username': '[email protected]', 'password': 'password',
+ 'next': '/cart/'}
+ response = client.post(url, data)
+ redirect_location = get_redirect_location(response)
+ assert redirect_location == '/cart/'
+
+
def test_logout_view_no_user(client):
url = reverse('account_logout')
response = client.get(url)