-
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.
Finish the unittesting for the user pages routes/status codes & start…
… with their content testing.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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,26 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.test import TestCase | ||
|
||
from backend import constants | ||
|
||
User = get_user_model() | ||
|
||
|
||
class TestContent(TestCase): | ||
TOTAL = constants.PAGINATOR_NUM + 1 | ||
|
||
@classmethod | ||
def setUpTestData(cls): | ||
User.objects.bulk_create( | ||
User( | ||
username=f"{constants.TEST_USER_DATA_2['username']}{idx}", | ||
first_name=f"{constants.TEST_USER_DATA_2['first_name']}{idx}", | ||
last_name=f"{constants.TEST_USER_DATA_2['last_name']}{idx}", | ||
email=f"{constants.TEST_USER_DATA_2['email']}{idx}", | ||
password=f"{constants.TEST_USER_DATA_2['password']}{idx}", | ||
) | ||
for idx in range(cls.TOTAL) | ||
) | ||
|
||
def test_number_users(self): | ||
self.assertEqual(User.objects.count(), self.TOTAL) |
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