Skip to content

Commit

Permalink
Skip more tests on py35 due to dict randomization
Browse files Browse the repository at this point in the history
  • Loading branch information
grigi committed Aug 20, 2019
1 parent 81b043a commit 9d8dc9f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tortoise/tests/test_describe_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys

from tortoise import Tortoise
from tortoise.contrib import test
Expand Down Expand Up @@ -36,6 +37,7 @@ async def test_describe_models_some(self):
{"models.Event", "models.Tournament", "models.Reporter", "models.Team"}, set(val.keys())
)

@test.skipIf(sys.version_info < (3, 6), "Dict not sorted in 3.5")
async def test_describe_model_straight(self):
val = Tortoise.describe_model(StraightFields)

Expand Down Expand Up @@ -152,6 +154,7 @@ async def test_describe_model_straight(self):
},
)

@test.skipIf(sys.version_info < (3, 6), "Dict not sorted in 3.5")
async def test_describe_model_source(self):
val = Tortoise.describe_model(SourceFields)

Expand Down Expand Up @@ -268,6 +271,7 @@ async def test_describe_model_source(self):
},
)

@test.skipIf(sys.version_info < (3, 6), "Dict not sorted in 3.5")
async def test_describe_model_uuidpk(self):
val = Tortoise.describe_model(UUIDPkModel)

Expand Down Expand Up @@ -323,6 +327,7 @@ async def test_describe_model_uuidpk(self):
},
)

@test.skipIf(sys.version_info < (3, 6), "Dict not sorted in 3.5")
async def test_describe_model_json(self):
val = Tortoise.describe_model(JSONFields)

Expand Down Expand Up @@ -372,6 +377,18 @@ async def test_describe_model_json(self):
"default": None,
"description": None,
},
{
"name": "data_default",
"field_type": "JSONField",
"db_column": "data_default",
"python_type": ["dict", "list"],
"generated": False,
"nullable": False,
"unique": False,
"indexed": False,
"default": "{'a': 1}",
"description": None,
},
],
"fk_fields": [],
"backward_fk_fields": [],
Expand Down
1 change: 1 addition & 0 deletions tortoise/tests/testmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class JSONFields(Model):
id = fields.IntField(pk=True)
data = fields.JSONField()
data_null = fields.JSONField(null=True)
data_default = fields.JSONField(default={"a": 1})


class UUIDFields(Model):
Expand Down

0 comments on commit 9d8dc9f

Please sign in to comment.