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.

12345678910111213141516171819202122232425262728
  1. from django.core.urlresolvers import reverse
  2. from django.test import TestCase
  3. from oscar.apps.dashboard.orders.tests import *
  4. from oscar.apps.dashboard.reports.tests import *
  5. from oscar.apps.dashboard.users.tests import *
  6. from oscar.apps.dashboard.promotions.tests import *
  7. from oscar.test import ClientTestCase
  8. class AnonymousUserTests(ClientTestCase):
  9. def test_login_form_is_displayed_for_anon_user(self):
  10. response = self.client.get(reverse('dashboard:index'))
  11. self.assertTrue('Username' in response.content)
  12. class DashboardViewTests(ClientTestCase):
  13. is_staff = True
  14. def test_dashboard_index_is_for_staff_only(self):
  15. urls = ('dashboard:index',
  16. 'dashboard:order-list',
  17. 'dashboard:users-index',)
  18. for name in urls:
  19. response = self.client.get(reverse(name))
  20. self.assertTrue('Password' not in response.content)