Add test for CHARTBEAT_AUTO_DOMAIN

Even if 'django.contrib.sites' is in INSTALLED_APPS, don't add the
domain if CHARTBEAT_AUTO_DOMAIN is False
This commit is contained in:
Eric Davis 2011-06-29 12:07:37 -07:00
parent 249dac1467
commit 6187229e3e

View file

@ -38,6 +38,16 @@ class ChartbeatTagTestCaseWithSites(TagTestCase):
self.assertTrue(re.search(
'var _sf_async_config={.*"domain": "test.com".*};', r), r)
@override_settings(CHARTBEAT_AUTO_DOMAIN=False)
def test_auto_domain_false(self):
"""
Even if 'django.contrib.sites' is in INSTALLED_APPS, if
CHARTBEAT_AUTO_DOMAIN is False, ensure there is no 'domain'
in _sf_async_config.
"""
r = ChartbeatBottomNode().render(Context())
self.assertTrue('var _sf_async_config={"uid": "12345"};' in r, r)
class ChartbeatTagTestCase(TagTestCase):
"""
Tests for the ``chartbeat`` template tag.