diff options
author | 2020-09-20 00:04:20 +1000 | |
---|---|---|
committer | 2020-09-20 00:04:20 +1000 | |
commit | 394d1ca151ad28be431eff8f25dde5707eeb0d47 (patch) | |
tree | 39ecc3705d676743c138c22586cecc3e2a72e778 | |
parent | Update user model in DeletedMessagesLogURLTests. (diff) |
Test username property formatting for user model.
-rw-r--r-- | pydis_site/apps/api/tests/test_users.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pydis_site/apps/api/tests/test_users.py b/pydis_site/apps/api/tests/test_users.py index 4c0f6e27..a02fce8a 100644 --- a/pydis_site/apps/api/tests/test_users.py +++ b/pydis_site/apps/api/tests/test_users.py @@ -143,7 +143,7 @@ class UserModelTests(APISubdomainTestCase): cls.user_with_roles = User.objects.create( id=1, name="Test User with two roles", - discriminator=1111, + discriminator=1, in_guild=True, ) cls.user_with_roles.roles.extend([cls.role_bottom.id, cls.role_top.id]) @@ -166,3 +166,7 @@ class UserModelTests(APISubdomainTestCase): top_role = self.user_without_roles.top_role self.assertIsInstance(top_role, Role) self.assertEqual(top_role.id, self.developers_role.id) + + def test_correct_username_formatting(self): + """Tests the username property with both name and discriminator formatted together.""" + self.assertEqual(self.user_with_roles.username, "Test User with two roles#0001") |