def test_identify_anonymous_user(self):
     r = KissInsightsNode().render(Context({'user': AnonymousUser()}))
     self.assertFalse("_kiq.push(['identify', " in r, r)
 def test_show_survey(self):
     r = KissInsightsNode().render(
         Context({'kiss_insights_show_survey': 1234}))
     self.assertTrue("_kiq.push(['showSurvey', 1234]);" in r, r)
 def test_node(self):
     r = KissInsightsNode().render(Context())
     self.assertTrue("//s3.amazonaws.com/ki.js/12345/abc.js" in r, r)
 def test_identify(self):
     r = KissInsightsNode().render(Context({'user': User(username='******')}))
     self.assertTrue("_kiq.push(['identify', 'test']);" in r, r)
Exemplo n.º 5
0
 def test_identify_anonymous_user(self):
     r = KissInsightsNode().render(Context({'user': AnonymousUser()}))
     assert "_kiq.push(['identify', " not in r
Exemplo n.º 6
0
 def test_wrong_site_id(self):
     with pytest.raises(AnalyticalException):
         KissInsightsNode()
Exemplo n.º 7
0
 def test_wrong_account_number(self):
     with pytest.raises(AnalyticalException):
         KissInsightsNode()
Exemplo n.º 8
0
 def test_no_site_code(self):
     with pytest.raises(AnalyticalException):
         KissInsightsNode()
Exemplo n.º 9
0
 def test_identify(self):
     self.settings_manager.set(ANALYTICAL_AUTO_IDENTIFY=True)
     r = KissInsightsNode().render(Context({'user': User(username='******')}))
     self.assertTrue("_kiq.push(['identify', 'test']);" in r, r)