From 196ac5684f3dbe249875068c344148934427df0b Mon Sep 17 00:00:00 2001 From: Anler Hp Date: Fri, 1 Aug 2014 15:07:57 +0200 Subject: [PATCH] Fix api auth tests --- taiga/auth/services.py | 2 +- tests/integration/test_auth_api.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/taiga/auth/services.py b/taiga/auth/services.py index 1f3c4640..5e22b4bc 100644 --- a/taiga/auth/services.py +++ b/taiga/auth/services.py @@ -87,7 +87,7 @@ def get_membership_by_token(token:str): is raised. """ membership_model = get_model("projects", "Membership") - qs = membership_model.objects.filter(user__isnull=True, token=token) + qs = membership_model.objects.filter(token=token) if len(qs) == 0: raise exc.NotFound("Token not matches any valid invitation.") return qs[0] diff --git a/tests/integration/test_auth_api.py b/tests/integration/test_auth_api.py index d9bc09b5..1774205a 100644 --- a/tests/integration/test_auth_api.py +++ b/tests/integration/test_auth_api.py @@ -61,7 +61,8 @@ def test_respond_201_if_domain_allows_public_registration(client, register_form) }) response = client.post(reverse("auth-register"), register_form) - assert response.status_code == 201 + + assert response.status_code == 201, response.data def test_response_200_in_registration_with_github_account(client):