66from unittest import mock
77
88import pytest
9+ from constance .test import override_config
910from django .core .management import call_command
1011from responses import RequestsMock
1112
@@ -43,6 +44,7 @@ def environment() -> dict[str, str]:
4344@pytest .mark .parametrize ("static" , [True , False ], ids = ["static" , "no-static" ])
4445@pytest .mark .parametrize ("verbosity" , [1 , 0 ], ids = ["verbose" , "" ])
4546@pytest .mark .parametrize ("migrate" , [True , False ], ids = ["migrate" , "" ])
47+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
4648def test_upgrade_init (
4749 verbosity : int ,
4850 migrate : bool ,
@@ -81,6 +83,7 @@ def test_upgrade_init(
8183
8284@pytest .mark .parametrize ("verbosity" , [1 , 0 ], ids = ["verbose" , "" ])
8385@pytest .mark .parametrize ("migrate" , [1 , 0 ], ids = ["migrate" , "" ])
86+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
8487def test_upgrade (verbosity : int , migrate : int , monkeypatch : pytest .MonkeyPatch , environment : dict [str , str ]) -> None :
8588 from testutils .factories import SuperUserFactory
8689
@@ -91,6 +94,7 @@ def test_upgrade(verbosity: int, migrate: int, monkeypatch: pytest.MonkeyPatch,
9194 assert "error" not in str (out .getvalue ())
9295
9396
97+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
9498def test_upgrade_next (mocked_responses : RequestsMock ) -> None :
9599 from testutils .factories import SuperUserFactory
96100
@@ -100,6 +104,7 @@ def test_upgrade_next(mocked_responses: RequestsMock) -> None:
100104 assert "error" not in str (out .getvalue ())
101105
102106
107+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
103108def test_upgrade_check (mocked_responses : RequestsMock , admin_user : "User" , environment : dict [str , str ]) -> None :
104109 out = StringIO ()
105110 with mock .patch .dict (os .environ , environment , clear = True ):
@@ -125,6 +130,7 @@ def test_upgrade_admin(mocked_responses: RequestsMock, environment: dict[str, st
125130@pytest .mark .default_cassette ("test_sync_all.yaml" )
126131@pytest .mark .vcr
127132@pytest .mark .xdist_group ("remote" )
133+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
128134def test_upgrade_sync (environment : dict [str , str ]) -> None :
129135 out = StringIO ()
130136 with mock .patch .dict (os .environ , environment , clear = True ):
@@ -137,6 +143,7 @@ def test_upgrade_sync(environment: dict[str, str]) -> None:
137143@pytest .mark .default_cassette ("test_sync_all.yaml" )
138144@pytest .mark .vcr
139145@pytest .mark .xdist_group ("remote" )
146+ @override_config (HOPE_API_URL = "https://dev-hope.unitst.org/api/rest/" )
140147def test_sync (environment : dict [str , str ]) -> None :
141148 out = StringIO ()
142149 with mock .patch .dict (os .environ , environment , clear = True ):
0 commit comments