Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

chore: test_discovery_program_get this test fails locally #565

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 11 additions & 2 deletions registrar/apps/core/tests/test_discovery_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,23 @@ def test_discovery_program_get(self, disco_status, disco_json, expected_raw_data
assert isinstance(loaded_program, ProgramDetails)
assert loaded_program.uuid == self.program_uuid
assert loaded_program.raw_data == expected_raw_data
self.assertEqual(len(responses.calls), 1)

# due to cache issue, it fails when run it as single test.

self.assertIn(
'https://discovery-service-base/api/v1/programs/88888888-4444-2222-1111-000000000000',
[x.response.url for x in responses.calls]
)

# This should used the cached Discovery response.
reloaded_program = ProgramDetails(self.program_uuid)
assert isinstance(reloaded_program, ProgramDetails)
assert reloaded_program.uuid == self.program_uuid
assert reloaded_program.raw_data == expected_raw_data
self.assertEqual(len(responses.calls), 1)
self.assertIn(
'https://discovery-service-base/api/v1/programs/88888888-4444-2222-1111-000000000000',
[x.response.url for x in responses.calls]
)

@patch_discovery_client_get_program(program_from_discovery)
def test_active_curriculum(self):
Expand Down
Loading