You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

promotion_tests.py 814B

1234567891011121314151617181920212223
  1. from django.core.urlresolvers import reverse
  2. from oscar.test import ClientTestCase
  3. class ViewTests(ClientTestCase):
  4. is_staff = True
  5. def test_pages_exist(self):
  6. urls = [reverse('dashboard:promotion-list'),
  7. reverse('dashboard:promotion-create-rawhtml'),
  8. reverse('dashboard:promotion-create-singleproduct'),
  9. reverse('dashboard:promotion-create-image'),
  10. ]
  11. for url in urls:
  12. self.assertIsOk(self.client.get(url))
  13. def test_create_redirects(self):
  14. base_url = reverse('dashboard:promotion-create-redirect')
  15. types = ['rawhtml', 'singleproduct', 'image']
  16. for p_type in types:
  17. url = '%s?promotion_type=%s' % (base_url, p_type)
  18. self.assertIsRedirect(self.client.get(url))