diff options
| author | Hasan <hasan.r67@gmail.com> | 2016-01-17 14:56:39 +0330 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-29 12:32:18 -0500 |
| commit | 3d0dcd7f5af378d3ab6adb303b913e6c7b2e0ee5 (patch) | |
| tree | 0d1074cc65a72096e44a4165611fddfc5b7ef7fb /tests/datatypes | |
| parent | 575706331bec4bf58ce36a9540c4c61fca49025b (diff) | |
Refs #26022 -- Used context manager version of assertRaises in tests.
Diffstat (limited to 'tests/datatypes')
| -rw-r--r-- | tests/datatypes/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/datatypes/tests.py b/tests/datatypes/tests.py index a69855da1f..612b1ae2e4 100644 --- a/tests/datatypes/tests.py +++ b/tests/datatypes/tests.py @@ -82,8 +82,9 @@ class DataTypesTestCase(TestCase): an error if given a timezone-aware datetime object.""" dt = datetime.datetime(2008, 8, 31, 16, 20, tzinfo=utc) d = Donut(name='Bear claw', consumed_at=dt) - self.assertRaises(ValueError, d.save) - # ValueError: MySQL backend does not support timezone-aware datetimes. + # MySQL backend does not support timezone-aware datetimes. + with self.assertRaises(ValueError): + d.save() def test_datefield_auto_now_add(self): """Regression test for #10970, auto_now_add for DateField should store |
