Skip to content

Commit 84e1c29

Browse files
committed
more CI work
1 parent 1cd967f commit 84e1c29

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
poetry install -E properties
124124
- name: Unit Tests w/ enum-properties
125125
run: |
126+
poetry run ./manage.py makemigrations
126127
poetry run pytest --cov-append
127128
- name: Remove enum-properties
128129
run: |
@@ -141,6 +142,7 @@ jobs:
141142
poetry run pytest --cov-append
142143
- name: Install all deps
143144
run: |
145+
poetry run ./manage.py makemigrations
144146
poetry install -E all
145147
- name: Run Full Unit Tests
146148
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,4 @@ test.db
134134
tests/edit_tests/migrations/00*.py
135135
benchmark.db
136136
type_check.py
137+
tests/**/migrations/**py

django_enum/choices.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66

77
import enum
88

9+
from django import VERSION as django_version
910
from django.db.models import Choices
1011
from django.db.models import IntegerChoices as DjangoIntegerChoices
1112
from django.db.models import TextChoices as DjangoTextChoices
1213
from django.db.models import enums as model_enums
1314

1415
from django_enum.utils import choices, names
1516

16-
ChoicesType = getattr(model_enums, "ChoicesType", getattr(model_enums, "ChoicesMeta"))
17+
18+
ChoicesType = (
19+
model_enums.ChoicesType
20+
if django_version[0:2] >= (5, 0) else
21+
model_enums.ChoicesMeta
22+
)
1723

1824
DEFAULT_BOUNDARY = getattr(enum, "KEEP", None)
1925

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ sphinx = true
150150
DJANGO_SETTINGS_MODULE = "tests.settings"
151151
python_files = "tests.py"
152152
norecursedirs = "*.egg .eggs dist build docs .tox .git __pycache__"
153-
env = ["TERMINAL_WIDTH=80"]
154153

155154
addopts = [
156155
"--strict-markers",

0 commit comments

Comments
 (0)