Added tests for RequestSite.__init__() and __str__().

This commit is contained in:
Mads Jensen 2017-09-27 17:22:50 +02:00 committed by Tim Graham
parent 2015f5f134
commit 129f4900be
1 changed files with 7 additions and 0 deletions

View File

@ -214,6 +214,13 @@ class RequestSiteTests(SimpleTestCase):
request.META = {'HTTP_HOST': 'example.com'}
self.site = RequestSite(request)
def test_init_attributes(self):
self.assertEqual(self.site.domain, 'example.com')
self.assertEqual(self.site.name, 'example.com')
def test_str(self):
self.assertEqual(str(self.site), 'example.com')
def test_save(self):
msg = 'RequestSite cannot be saved.'
with self.assertRaisesMessage(NotImplementedError, msg):