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.

test_custom.py 853B

1234567891011121314151617181920212223
  1. from django.test import TestCase
  2. from oscar.apps.offer import custom
  3. from tests._site.model_tests_app.models import CustomBenefitWithoutName, CustomConditionWithoutName
  4. class TestCustomBenefit(TestCase):
  5. def setUp(self):
  6. self.custom_benefit = custom.create_benefit(CustomBenefitWithoutName)
  7. def test_benefit_raises_assert_on_missing_title(self):
  8. with self.assertRaisesMessage(AssertionError, 'Name property is not defined on proxy class.'):
  9. str(self.custom_benefit)
  10. class TestCustomCondition(TestCase):
  11. def setUp(self):
  12. self.custom_condition = custom.create_condition(CustomConditionWithoutName)
  13. def test_benefit_raises_assert_on_missing_title(self):
  14. with self.assertRaisesMessage(AssertionError, 'Name property is not defined on proxy class.'):
  15. str(self.custom_condition)