Skip to content

Commit

Permalink
Remove lingering references to @with_mocked_httpx_get
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Walz authored and Jon Walz committed Mar 8, 2024
1 parent e67d33d commit c3244d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions addon_service/tests/test_by_type/test_resource_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from addon_service.tests._helpers import (
MockOSF,
get_test_request,
with_mocked_httpx_get,
)
from app import settings

Expand Down Expand Up @@ -194,26 +193,31 @@ def setUpTestData(cls):
# _user magically becomes the current requester
cls._user = cls._csa.base_account.external_account.owner

@with_mocked_httpx_get
def setUp(self):
self._mock_osf = MockOSF()
self._mock_osf.configure_user_role(
self._user.user_uri, self._resource.resource_uri, "admin"
)
self.enterContext(self._mock_osf)

def test_get_related__empty(self):
self._csa.delete()

_resp = self._related_view(
get_test_request(cookies={"osf": "This is my chosen form of auth"}),
get_test_request(cookies={"osf": self._user.user_uri}),
pk=self._resource.pk,
related_field="configured_storage_addons",
)
self.assertEqual(_resp.status_code, HTTPStatus.OK)
self.assertEqual(_resp.data, [])

@with_mocked_httpx_get
def test_get_related__several(self):
_addons = _factories.ConfiguredStorageAddonFactory.create_batch(
size=4,
authorized_resource=self._resource,
) + [self._csa]
_resp = self._related_view(
get_test_request(cookies={"osf": "This is my chosen form of auth"}),
get_test_request(cookies={"osf": self._user.user_uri}),
pk=self._resource.pk,
related_field="configured_storage_addons",
)
Expand Down

0 comments on commit c3244d2

Please sign in to comment.