Skip to content

Commit

Permalink
Add test for CHARTBEAT_AUTO_DOMAIN
Browse files Browse the repository at this point in the history
Even if 'django.contrib.sites' is in INSTALLED_APPS, don't add the
domain if CHARTBEAT_AUTO_DOMAIN is False
  • Loading branch information
Eric Davis committed Jun 29, 2011
1 parent 249dac1 commit 6187229
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions analytical/tests/test_tag_chartbeat.py
Expand Up @@ -38,6 +38,16 @@ def test_rendering_setup_site(self):
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.
Expand Down

0 comments on commit 6187229

Please sign in to comment.