Skip to content

Commit

Permalink
try fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Aug 22, 2024
1 parent 7bc8520 commit 6a921b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 13 additions & 9 deletions tests/db/models/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,19 @@ def test_check_sf_object_name_concrete(self):
# invalid when just definiting `Meta.app_label`.
# So for this test we just use an existing model and break
# it.
setattr(NumberModel, "sf_object_name", None)

errors = NumberModel.check()
assert errors == [
checks.Error(
'testapp.NumberModel must define a "sf_object_name".',
id="heroku_connect.E001",
)
]
old_name = NumberModel.sf_object_name
try:
setattr(NumberModel, "sf_object_name", None)

errors = NumberModel.check()
assert errors == [
checks.Error(
'testapp.NumberModel must define a "sf_object_name".',
id="heroku_connect.E001",
)
]
finally:
setattr(NumberModel, "sf_object_name", old_name)

def test_check_sf_access(self):
class MyModel(hc_models.HerokuConnectModel):
Expand Down
2 changes: 0 additions & 2 deletions tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from heroku_connect.db import models as hc_models

__all__ = ("NumberModel", "OtherModel")


def frozen_uuid_generator():
return uuid.UUID(hex="653d1c6863404b9689b75fa930c9d0a0")
Expand Down

0 comments on commit 6a921b0

Please sign in to comment.