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 799B

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