some cleanup and refactoring

This commit is contained in:
collerek
2020-12-06 08:23:57 +01:00
parent 1d4a074c2c
commit 9838547c4f
2 changed files with 21 additions and 18 deletions

View File

@ -219,7 +219,7 @@ def test_excluding_fields_in_endpoints():
assert isinstance(user_instance.timestamp, datetime.datetime)
assert user_instance.timestamp == timestamp
response = client.post("/users4/", json=user)
response = client.post("/users4/", json=user3)
assert list(response.json().keys()) == [
"id",
"email",
@ -228,8 +228,12 @@ def test_excluding_fields_in_endpoints():
"category",
"timestamp",
]
assert response.json().get("timestamp") != str(timestamp).replace(" ", "T")
assert response.json().get("timestamp") is not None
assert (
datetime.datetime.strptime(
response.json().get("timestamp"), "%Y-%m-%dT%H:%M:%S.%f"
)
== timestamp
)
def test_adding_fields_in_endpoints():