-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugs: new users default policy; org creation
- Add default policy to new users - Bump django-tutelary dependency for better queryset filtering - Avoid using "default" as a policy name in tests - Make creator of organization an org admin - DRY tox and setup dependency configuration - Fix up policy creation in functional tests
- Loading branch information
Ian Ross
committed
Apr 22, 2016
1 parent
bb51bf2
commit 7956a82
Showing
30 changed files
with
185 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include requirements/*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,10 +61,8 @@ def test_signup_with_existing_email(self): | |
|
||
class ProfileFormTest(TestCase): | ||
def test_update_user(self): | ||
user = UserFactory.create(**{ | ||
'username': 'imagine71', | ||
'email': '[email protected]' | ||
}) | ||
user = UserFactory.create(username='imagine71', | ||
email='[email protected]') | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
|
@@ -80,10 +78,8 @@ def test_update_user(self): | |
|
||
def test_update_user_with_existing_username(self): | ||
UserFactory.create(username='existing') | ||
user = UserFactory.create(**{ | ||
'username': 'imagine71', | ||
'email': '[email protected]' | ||
}) | ||
user = UserFactory.create(username='imagine71', | ||
email='[email protected]') | ||
data = { | ||
'username': 'existing', | ||
'email': '[email protected]', | ||
|
@@ -95,10 +91,8 @@ def test_update_user_with_existing_username(self): | |
|
||
def test_update_user_with_existing_email(self): | ||
UserFactory.create(email='[email protected]') | ||
user = UserFactory.create(**{ | ||
'username': 'imagine71', | ||
'email': '[email protected]' | ||
}) | ||
user = UserFactory.create(username='imagine71', | ||
email='[email protected]') | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,7 @@ def test_create_with_existing_email(self): | |
"""Serialiser should be invalid when another user with the same email | ||
address is already registered.""" | ||
|
||
UserFactory.create(**{ | ||
'email': '[email protected]', | ||
}) | ||
UserFactory.create(email='[email protected]') | ||
|
||
data = { | ||
'username': 'imagine71', | ||
|
@@ -137,11 +135,9 @@ def test_unverified_account(self): | |
"""Serializer should raise EmailNotVerifiedError exeception when the | ||
user has not verified their email address within 48 hours""" | ||
|
||
UserFactory.create(**{ | ||
'username': 'sgt_pepper', | ||
'password': 'iloveyoko79', | ||
'verify_email_by': datetime.now() | ||
}) | ||
UserFactory.create(username='sgt_pepper', | ||
password='iloveyoko79', | ||
verify_email_by=datetime.now()) | ||
|
||
with pytest.raises(EmailNotVerifiedError): | ||
AccountLoginSerializer().validate(attrs={ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,11 +103,9 @@ def test_user_signs_up_with_invalid(self): | |
|
||
class AccountLoginTest(TestCase): | ||
def setUp(self): | ||
self.user = UserFactory.create(**{ | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
'password': 'iloveyoko79' | ||
}) | ||
self.user = UserFactory.create(username='imagine71', | ||
email='[email protected]', | ||
password='iloveyoko79') | ||
|
||
def _post(self, data, status=None, token=None): | ||
url = '/v1/account/login/' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.