Skip to content

Commit 4a95ce8

Browse files
author
Michael Barr
committed
Fixed test to check for ValueError, not ValidationError.
1 parent 3a7141e commit 4a95ce8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/test_invalid_tzdatetimefield.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
import pytz
66

77
# Django
8-
from django.core.exceptions import ValidationError
98
from django.test import TestCase
109

1110
# App
12-
from tests.models import (ModelWithBadPopulateFrom,
13-
ModelWithBadTimeOverride,
14-
ModelWithBadTimeZoneCharField)
11+
from tests.models import (ModelWithBadPopulateFrom, ModelWithBadTimeOverride,
12+
ModelWithBadTimeZoneCharField)
1513

1614

1715
# ==============================================================================
@@ -23,7 +21,7 @@ def test_invalid_field_reference_string(self):
2321
ModelWithBadPopulateFrom.objects.create(),
2422

2523
def test_bad_time_override_value(self):
26-
with self.assertRaises(ValidationError):
24+
with self.assertRaises(ValueError):
2725
ModelWithBadTimeOverride.objects.create()
2826

2927
def test_bad_populate_from_timezone_as_charfield(self):

0 commit comments

Comments
 (0)