Skip to content

Commit

Permalink
Refs #34986 -- Removed redundant CustomChoicesTests.test_timezone_uns…
Browse files Browse the repository at this point in the history
…upported().

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.
  • Loading branch information
ngnpope authored and felixxm committed Nov 29, 2023
1 parent f5f55b4 commit 06c5cb1
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions tests/model_enums/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,6 @@ def test_bool_unsupported(self):
class Boolean(bool, models.Choices):
pass

def test_timezone_unsupported(self):
msg = "type 'datetime.timezone' is not an acceptable base type"
with self.assertRaisesMessage(TypeError, msg):

class Timezone(datetime.timezone, models.Choices):
pass

def test_uuid_unsupported(self):
with self.assertRaises(TypeError):

Expand Down

0 comments on commit 06c5cb1

Please sign in to comment.