Skip to content

Commit 0dc6fb1

Browse files
committed
fix path enum tests on windows
1 parent 52d5b99 commit 0dc6fb1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ test-filters *TESTS:
255255
@just run --no-default-groups --extra filters --group test --exact --isolated pytest {{ TESTS }} --cov-append
256256

257257
test *TESTS:
258-
@just run --no-default-groups --exact --group test --isolated pytest {{ TESTS }} --cov-append
258+
@just run --no-default-groups --exact --all-extras --group test --isolated pytest {{ TESTS }} --cov-append
259259

260260
# debug an test
261261
debug-test *TESTS:

tests/test_eccentric.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def test_enum_choice_field(self):
123123
self.assertEqual(form_field3.primitive, str)
124124

125125
def test_custom_primitive(self):
126+
from pathlib import PurePosixPath
126127
from tests.djenum.enums import PathEnum, StrProps, StrPropsEnum
127128
from tests.djenum.models import CustomPrimitiveTestModel
128129

@@ -139,7 +140,7 @@ def test_custom_primitive(self):
139140
self.assertEqual(obj2.str_props, StrPropsEnum.STR2)
140141

141142
obj3 = CustomPrimitiveTestModel.objects.create(
142-
path=Path("/usr/local/bin"), str_props=StrProps("str3")
143+
path=PurePosixPath("/usr/local/bin"), str_props=StrProps("str3")
143144
)
144145
self.assertEqual(obj3.path, PathEnum.USR_LOCAL_BIN)
145146
self.assertEqual(obj3.str_props, StrPropsEnum.STR3)
@@ -154,7 +155,7 @@ def test_custom_primitive(self):
154155

155156
self.assertEqual(
156157
obj3,
157-
CustomPrimitiveTestModel.objects.get(path=Path("/usr/local/bin")),
158+
CustomPrimitiveTestModel.objects.get(path=PurePosixPath("/usr/local/bin")),
158159
)
159160

160161
self.assertEqual(

0 commit comments

Comments
 (0)