Fix uservoice tests

Rewrite test_empty_key in the same way as in the other modules.
Delete test_overridden_empty_key, because the Node (In this case, the UserVoiceNode) should not be created if there is no configuration initially.
This commit is contained in:
Bodnar Bogdan 2017-08-16 10:20:13 +02:00
parent add3baff74
commit 22403f9a03

View file

@ -40,14 +40,7 @@ class UserVoiceTagTestCase(TagTestCase):
@override_settings(USERVOICE_WIDGET_KEY='')
def test_empty_key(self):
r = UserVoiceNode().render(Context())
self.assertEqual(r, "")
@override_settings(USERVOICE_WIDGET_KEY='')
def test_overridden_empty_key(self):
vars = {'uservoice_widget_key': 'bcdefghijklmnopqrstu'}
r = UserVoiceNode().render(Context(vars))
self.assertIn("widget.uservoice.com/bcdefghijklmnopqrstu.js", r)
self.assertRaises(AnalyticalException, UserVoiceNode)
def test_overridden_key(self):
vars = {'uservoice_widget_key': 'defghijklmnopqrstuvw'}