-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Superusers must be active by default
- Loading branch information
1 parent
6ee0178
commit 443019b
Showing
3 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
|
@@ -106,6 +106,7 @@ def test_create_superuser_OK(self): | |
admin_user = Account.objects.create_superuser(**data) | ||
self.assertTrue(admin_user.is_staff) | ||
self.assertTrue(admin_user.is_superuser) | ||
self.assertTrue(admin_user.is_active) | ||
|
||
def test_create_superuser_KO_if_is_staff_manually_set_to_False_KO(self): | ||
data = self.__modify_data( | ||
|
@@ -121,6 +122,13 @@ def test_create_superuser_KO_if_is_superuser_manually_set_to_False_KO(self): | |
with self.assertRaises(ValueError): | ||
Account.objects.create_superuser(is_superuser=False, **data) | ||
|
||
def test_create_superuser_KO_if_is_active_manually_set_to_False_KO(self): | ||
data = self.__modify_data( | ||
{"username": "jdoe", "phone_number": 987654321, "email": "[email protected]"} | ||
) | ||
with self.assertRaises(ValueError): | ||
Account.objects.create_superuser(is_active=False, **data) | ||
|
||
## UPDATE TESTS | ||
|
||
def test_update_account_OK(self): | ||
|