Skip to content

Instantly share code, notes, and snippets.

@andymckay
Created August 18, 2011 17:22
Show Gist options
  • Save andymckay/1154576 to your computer and use it in GitHub Desktop.
Save andymckay/1154576 to your computer and use it in GitHub Desktop.
@mock.patch.object(waffle, 'switch_is_active', lambda x: True)
def test_marketplace(self):
addon = Addon.objects.get(pk=3615)
#with patch_waffle('switch', lambda x: True):
res = self.client.get(reverse('devhub.submit.7',
args=[addon.slug]))
eq_('If this is a premium add-on' in res.content, True)
~/sandboxes/zamboni(679888) $ test apps/devhub/tests/test_views.py:TestSubmitStep7
...
FAIL: zamboni.apps.devhub.tests.test_views:TestSubmitStep7.test_marketplace
$EDITOR +2555 apps/devhub/tests/test_views.py
File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/utils/unittest/case.py", line 339, in run
testMethod()
File "/Users/andy/sandboxes/zamboni/vendor/lib/python/mock.py", line 566, in patched
return func(*args, **keywargs)
File "/Users/andy/sandboxes/zamboni/../zamboni/apps/devhub/tests/test_views.py", line 2555, in test_marketplace
eq_('If this is a premium add-on' in res.content, True)
File "/Users/andy/sandboxes/zamboni/vendor/lib/python/nose/tools.py", line 31, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: False != True
8 tests, 1 failure, 0 errors in 6.4s
~/sandboxes/zamboni(679888) $ test apps/devhub/tests/test_views.py:TestSubmitStep7.test_marketplace
...
OK! 1 test, 0 failures, 0 errors in 1.5s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment