Skip to content

Commit 06c5cb1

Browse files
ngnpopefelixxm
authored andcommitted
Refs #34986 -- Removed redundant CustomChoicesTests.test_timezone_unsupported().
This test relied on the behavior of subclassing `datetime.timezone` which is not permitted by the C-extension version of CPython's `datetime` module. This restriction isn't enforced by the pure Python version, nor by PyPy. See python/cpython#112451 It's not critical, and doesn't test any Django behavior, so just remove it.
1 parent f5f55b4 commit 06c5cb1

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

tests/model_enums/tests.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,6 @@ def test_bool_unsupported(self):
316316
class Boolean(bool, models.Choices):
317317
pass
318318

319-
def test_timezone_unsupported(self):
320-
msg = "type 'datetime.timezone' is not an acceptable base type"
321-
with self.assertRaisesMessage(TypeError, msg):
322-
323-
class Timezone(datetime.timezone, models.Choices):
324-
pass
325-
326319
def test_uuid_unsupported(self):
327320
with self.assertRaises(TypeError):
328321

0 commit comments

Comments
 (0)