Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

test_alert.py 505B

123456789101112131415161718
  1. from django.test import TestCase
  2. from oscar.apps.customer.models import ProductAlert
  3. from oscar.core.compat import get_user_model
  4. from oscar.test.factories import UserFactory, create_product
  5. User = get_user_model()
  6. class TestAnAlertForARegisteredUser(TestCase):
  7. def setUp(self):
  8. user = UserFactory()
  9. product = create_product()
  10. self.alert = ProductAlert.objects.create(user=user, product=product)
  11. def test_defaults_to_active(self):
  12. assert self.alert.is_active