add test exclusion for postgres as it uses transaction timestamp

This commit is contained in:
collerek
2020-10-28 15:48:33 +01:00
parent f96845674b
commit 56c527485d
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
# 0.3.10
* Fix
# 0.3.9 # 0.3.9
* Fix json schema generation as of [#19][#19] * Fix json schema generation as of [#19][#19]

View File

@ -44,7 +44,7 @@ class BaseField:
return None return None
@classmethod @classmethod
def get_default(cls, use_server: bool = False) -> Any: # noqa CCR001 def get_default(cls, use_server: bool = False) -> Any: # noqa CCR001
if cls.has_default(): if cls.has_default():
default = ( default = (
cls.default cls.default

View File

@ -77,6 +77,9 @@ async def test_model_creation():
p2 = await Product.objects.create(name='Test3') p2 = await Product.objects.create(name='Test3')
assert p2.created is not None assert p2.created is not None
assert p1.created != p2.created
assert p2.company == 'Acme' assert p2.company == 'Acme'
assert p2.sort_order == 10 assert p2.sort_order == 10
if Product.db_backend_name() != 'postgresql':
# postgres use transaction timestamp so it will remain the same
assert p1.created != p2.created