Created
December 6, 2012 14:58
-
-
Save vojd/4225018 to your computer and use it in GitHub Desktop.
simple_django_test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_to_cart(product): | |
resp = self.client.post(reverse('add_to_cart_view', {'product' : product.pk} | |
return resp | |
def test_add_to_cart(): | |
# add all products to cart | |
for product in Product.objects.all(): | |
resp = add_to_cart(product) | |
self.assertEqual(resp.status_code, 302) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment