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

test_benefit.py 845B

12345678910111213141516171819202122232425
  1. from django.test import TestCase
  2. from django.utils import six
  3. from oscar.apps.offer.models import Benefit
  4. from oscar.test import factories
  5. class TestBenefitProxyModels(TestCase):
  6. def test_name_and_description(self):
  7. """
  8. Tests that the benefit proxy classes all return a name and
  9. description. Unfortunately, the current implementations means
  10. a valid range is required.
  11. This test became necessary because the complex name/description logic
  12. broke with the python_2_unicode_compatible decorator.
  13. """
  14. range = factories.RangeFactory()
  15. for type, __ in Benefit.TYPE_CHOICES:
  16. benefit = Benefit(type=type, range=range)
  17. self.assertTrue(all([
  18. benefit.name,
  19. benefit.description,
  20. six.text_type(benefit)]))