diff options
| author | 2019-10-11 21:41:56 +0200 | |
|---|---|---|
| committer | 2019-10-11 21:41:56 +0200 | |
| commit | a185a25066372e0d0bf608f71aef110dfe88d9a9 (patch) | |
| tree | 942478a63cd83f17517e177780de53170d020624 /pydis_site/apps/api/tests | |
| parent | Deny `LogEntry` deletion. (diff) | |
| parent | Merge pull request #269 from python-discord/migrate-nominations-to-nomination... (diff) | |
Merge branch 'master' into simple-admin-log-entry-view
Diffstat (limited to 'pydis_site/apps/api/tests')
| -rw-r--r-- | pydis_site/apps/api/tests/test_models.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pydis_site/apps/api/tests/test_models.py b/pydis_site/apps/api/tests/test_models.py index 6a3ef085..bce76942 100644 --- a/pydis_site/apps/api/tests/test_models.py +++ b/pydis_site/apps/api/tests/test_models.py @@ -10,6 +10,7 @@ from ..models import ( Message, MessageDeletionContext, ModelReprMixin, + Nomination, OffTopicChannelName, Reminder, Role, @@ -34,6 +35,19 @@ class ReprMixinTests(SimpleTestCase): class StringDunderMethodTests(SimpleTestCase): def setUp(self): + self.nomination = Nomination( + id=123, + actor=User( + id=9876, name='Mr. Hemlock', + discriminator=6666, avatar_hash=None + ), + user=User( + id=9876, name="Hemlock's Cat", + discriminator=7777, avatar_hash=None + ), + reason="He purrrrs like the best!", + ) + self.objects = ( DeletedMessage( id=45, @@ -109,3 +123,9 @@ class StringDunderMethodTests(SimpleTestCase): def test_returns_string(self): for instance in self.objects: self.assertIsInstance(str(instance), str) + + def test_nomination_str_representation(self): + self.assertEqual( + "Nomination of Hemlock's Cat#7777 (active)", + str(self.nomination) + ) |