def test_node(self):
     r = UserVoiceNode().render(Context())
     self.assertIn("widget.uservoice.com/abcdefghijklmnopqrst.js", r)
Esempio n. 2
0
 def test_auto_trigger_custom_win(self):
     r = UserVoiceNode().render(Context({'uservoice_add_trigger': True}))
     self.assertTrue("UserVoice.push(['addTrigger', {}]);" in r, r)
Esempio n. 3
0
 def test_auto_trigger(self):
     r = UserVoiceNode().render(Context())
     self.assertFalse("UserVoice.push(['addTrigger', {}]);" in r, r)
Esempio n. 4
0
 def test_override_options(self):
     data = {'uservoice_widget_options': {'key1': 'val2'}}
     r = UserVoiceNode().render(Context(data))
     self.assertIn("""UserVoice.push(['set', {"key1": "val2"}]);""", r)
Esempio n. 5
0
 def test_options(self):
     r = UserVoiceNode().render(Context())
     self.assertIn("""UserVoice.push(['set', {"key1": "val1"}]);""", r)
Esempio n. 6
0
 def test_overridden_key(self):
     vars = {'uservoice_widget_key': 'defghijklmnopqrstuvw'}
     r = UserVoiceNode().render(Context(vars))
     self.assertIn("widget.uservoice.com/defghijklmnopqrstuvw.js", r)