From 129f4900be086e373123f7d17ca0afb87fb91369 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Wed, 27 Sep 2017 17:22:50 +0200 Subject: [PATCH] Added tests for RequestSite.__init__() and __str__(). --- tests/sites_tests/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/sites_tests/tests.py b/tests/sites_tests/tests.py index 9751ce5449..4bbf9d2907 100644 --- a/tests/sites_tests/tests.py +++ b/tests/sites_tests/tests.py @@ -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):