tests.py 591 B

1234567891011121314151617181920212223
  1. from django.test import TestCase
  2. from contribmap.models import Contrib
  3. class TestContrib(TestCase):
  4. def test_comma_separatedcharfield(self):
  5. co = Contrib(name='foo', orientations=['SO', 'NE'])
  6. co.save()
  7. self.assertEqual(
  8. Contrib.objects.get(name='foo').orientations,
  9. ['SO', 'NE'])
  10. co.orientations = ['S']
  11. co.save()
  12. class TestDataImport(TestCase):
  13. fixtures = ['bottle_data.yaml']
  14. def test_re_save(self):
  15. for contrib in Contrib.objects.all():
  16. contrib.full_clean()
  17. contrib.save()