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.

notification_tests.py 581B

1234567891011121314151617
  1. from django.contrib.auth.models import User
  2. from django_dynamic_fixture import G
  3. from oscar.test import WebTestCase
  4. from oscar.apps.customer.notifications import services
  5. class TestAUserWithUnreadNotifications(WebTestCase):
  6. def setUp(self):
  7. self.user = G(User)
  8. services.notify_user(self.user, "Test message")
  9. def test_can_see_them_in_page_header(self):
  10. homepage = self.app.get('/', user=self.user)
  11. self.assertTrue('num_unread_notifications' in homepage.context)
  12. self.assertEqual(1, homepage.context['num_unread_notifications'])