Skip to content

Commit e4d32ca

Browse files
authored
Drop JSONField workarounds from tests (#569)
* Drop `JSONField` workarounds from tests * Add CHANGELOG.md entry
1 parent 64df82d commit e4d32ca

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
- [dev] Clean up stale TODO and fix signal handler leak in m2m test
1414

1515
### Removed
16+
- [dev] Drop JSONField workarounds from tests
1617

1718
## [1.23.0](https://pypi.org/project/model-bakery/1.23.0/)
1819

tests/test_filling_fields.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
validate_ipv46_address,
1313
)
1414
from django.db import connection
15-
from django.db.models import FileField, ImageField, fields
15+
from django.db.models import FileField, ImageField, JSONField, fields
1616

1717
import pytest
1818

@@ -22,19 +22,13 @@
2222
from model_bakery.random_gen import MAX_LENGTH, gen_from_choices, gen_related
2323
from tests.generic import generators, models
2424

25-
try:
26-
from django.db.models import JSONField
27-
except ImportError:
28-
JSONField = None
29-
3025
try:
3126
from django.contrib.postgres.fields import (
3227
ArrayField,
3328
CICharField,
3429
CIEmailField,
3530
CITextField,
3631
HStoreField,
37-
JSONField as PostgresJSONField,
3832
)
3933
from django.contrib.postgres.fields.ranges import (
4034
BigIntegerRangeField,
@@ -45,7 +39,6 @@
4539
)
4640
except ImportError:
4741
ArrayField = None
48-
PostgresJSONField = None
4942
HStoreField = None
5043
CICharField = None
5144
CIEmailField = None
@@ -201,7 +194,6 @@ def test_fill_UUIDField_with_uuid_object(self, person):
201194
assert isinstance(person.uuid, uuid.UUID)
202195

203196

204-
@pytest.mark.skipif(JSONField is None, reason="JSONField could not be imported")
205197
class TestJSONFieldsFilling:
206198
def test_fill_JSONField_with_uuid_object(self, person):
207199
json_field = models.Person._meta.get_field("data")

0 commit comments

Comments
 (0)