Skip to content

Commit ca3a2e7

Browse files
committed
fixes tests
1 parent 7ac81e4 commit ca3a2e7

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

ruff.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ case-sensitive = true
7979
force-wrap-aliases = true
8080
combine-as-imports = true
8181
extra-standard-library = ["path"]
82-
#default-section = "local-folder"
8382
known-third-party = ['django']
8483
known-first-party = ['hope_*']
8584
known-local-folder = ["country_workspace"]
8685
no-sections = false
8786
lines-after-imports = 1
8887
relative-imports-order = "furthest-to-closest"
89-
9088
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder",]
9189

9290

src/country_workspace/models/program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from strategy_field.fields import StrategyField
66
from strategy_field.utils import fqn
77

8+
from country_workspace.models.office import Office
89
from hope_flex_fields.models import DataChecker
910

1011
from ..validators.registry import NoopValidator, beneficiary_validator_registry
1112
from .base import BaseModel, Validable
12-
from .office import Office
1313

1414
if TYPE_CHECKING:
1515
from django.db.models import QuerySet

tests/test_commands.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_upgrade(verbosity: int, migrate: int, monkeypatch: pytest.MonkeyPatch,
8787
out = StringIO()
8888
SuperUserFactory()
8989
with mock.patch.dict(os.environ, environment, clear=True):
90-
call_command("upgrade", stdout=out, checks=False, verbosity=verbosity)
90+
call_command("upgrade", stdout=out, checks=False, verbosity=verbosity, sync_with_hope=False)
9191
assert "error" not in str(out.getvalue())
9292

9393

@@ -96,14 +96,14 @@ def test_upgrade_next(mocked_responses: RequestsMock) -> None:
9696

9797
SuperUserFactory()
9898
out = StringIO()
99-
call_command("upgrade", stdout=out, checks=False)
99+
call_command("upgrade", stdout=out, checks=False, sync_with_hope=False)
100100
assert "error" not in str(out.getvalue())
101101

102102

103103
def test_upgrade_check(mocked_responses: RequestsMock, admin_user: "User", environment: dict[str, str]) -> None:
104104
out = StringIO()
105105
with mock.patch.dict(os.environ, environment, clear=True):
106-
call_command("upgrade", stdout=out, checks=True)
106+
call_command("upgrade", stdout=out, checks=True, sync_with_hope=False)
107107

108108

109109
@pytest.mark.django_db(transaction=True)
@@ -118,7 +118,18 @@ def test_upgrade_admin(mocked_responses: RequestsMock, environment: dict[str, st
118118

119119
out = StringIO()
120120
with mock.patch.dict(os.environ, environment, clear=True):
121-
call_command("upgrade", stdout=out, checks=True, admin_email=email)
121+
call_command("upgrade", stdout=out, checks=True, admin_email=email, sync_with_hope=False)
122+
123+
124+
@pytest.mark.django_db(transaction=True)
125+
@pytest.mark.vcr
126+
@pytest.mark.xdist_group("remote")
127+
def test_upgrade_sync(environment: dict[str, str]) -> None:
128+
out = StringIO()
129+
with mock.patch.dict(os.environ, environment, clear=True):
130+
call_command(
131+
"upgrade", stdout=out, sync_with_hope=True, migrate=False, static=False, prompt=False, checks=False
132+
)
122133

123134

124135
@pytest.mark.django_db(transaction=True)

0 commit comments

Comments
 (0)