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_forms.py 532B

12345678910111213141516171819
  1. import datetime
  2. from django.test import TestCase
  3. from django.utils.timezone import now
  4. from oscar.apps.dashboard.offers import forms
  5. class TestRestrictionsFormEnforces(TestCase):
  6. def test_cronological_dates(self):
  7. start = now()
  8. end = start - datetime.timedelta(days=30)
  9. post = {'name': 'dummy',
  10. 'description': 'dummy',
  11. 'start_datetime': start,
  12. 'end_datetime': end}
  13. form = forms.RestrictionsForm(post)
  14. self.assertFalse(form.is_valid())