from django.test import TestCase from domains.models import MailDomain class MailDomainTest(TestCase): def test__str__(self): md = MailDomain.objects.create(domain='example.org') self.assertEqual(str(md), 'example.org')