Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up usage of object.__new__ and mocks for Model in unit tests #177

Merged
merged 2 commits into from
Aug 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/unit/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ def test_invalid_value():
@pytest.mark.usefixtures("in_context")
def test_unchecked_model_type():
value = model.Key("This", 1)
entity = object.__new__(model.Model)
entity = model.Model()

result = model._validate_key(value, entity=entity)
assert result is value
Expand All @@ -1335,7 +1335,7 @@ def test_unchecked_model_type():
@pytest.mark.usefixtures("in_context")
def test_unchecked_expando_type():
value = model.Key("This", 1)
entity = object.__new__(model.Expando)
entity = model.Expando()

result = model._validate_key(value, entity=entity)
assert result is value
Expand Down Expand Up @@ -1408,7 +1408,7 @@ def test__validate_wrong_type():
@staticmethod
@pytest.mark.usefixtures("in_context")
def test__set_value():
entity = object.__new__(model.Model)
entity = model.Model()
value = key_module.Key("Map", 8898)

model.ModelKey._set_value(entity, value)
Expand Down