1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

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

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):