コード例 #1
0
 def test_node(self):
     r = UserVoiceNode().render(Context())
     self.assertIn("widget.uservoice.com/abcdefghijklmnopqrst.js", r)
コード例 #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)
コード例 #3
0
 def test_auto_trigger(self):
     r = UserVoiceNode().render(Context())
     self.assertFalse("UserVoice.push(['addTrigger', {}]);" in r, r)
コード例 #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)
コード例 #5
0
 def test_options(self):
     r = UserVoiceNode().render(Context())
     self.assertIn("""UserVoice.push(['set', {"key1": "val1"}]);""", r)
コード例 #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)