Skip to content

Commit 85fd19c

Browse files
committed
adding latest versions and changes to the offset math test
1 parent 1ea136e commit 85fd19c

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

apps/fhir/bluebutton/tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def setUp(self):
235235
def test_crosswalk_fhir_id(self):
236236
""" Get the Crosswalk FHIR_Id """
237237

238-
for version in [Versions.V2, Versions.V3]:
238+
for version in Versions.latest_versions():
239239
u = User.objects.create_user(username=f"billybob-{version}",
240240
first_name="Billybob",
241241
last_name="Button",
@@ -258,7 +258,7 @@ def test_crosswalk_fhir_id(self):
258258

259259
def test_crosswalk_not_fhir_id(self):
260260
""" Get no Crosswalk id """
261-
for version in [Versions.V2, Versions.V3]:
261+
for version in Versions.latest_versions():
262262
u = User.objects.create_user(username=f"bobnobob-{version}",
263263
first_name="bob",
264264
last_name="Button",

apps/logging/tests/test_audit_loggers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def catchall(url, request):
295295
fhir_log_content = get_log_content(self.logger_registry, logging.AUDIT_DATA_FHIR_LOGGER)
296296
log_entries = fhir_log_content.splitlines()
297297

298-
self.assertEqual(len(log_entries), 6)
298+
self.assertEqual(len(log_entries), 4)
299299

300300
# Validate fhir_auth_pre_fetch entry
301301
self.assertTrue(

apps/mymedicare_cb/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
MAX_HICN_HASH_LENGTH = 64
1919
MAX_MBI_LENGTH = 11
20-
FHIR_ID_VERSIONS_TO_CHECK = [2, 3]
2120

2221

2322
class BBMyMedicareCallbackCrosswalkCreateException(APIException):
@@ -69,7 +68,7 @@ def get_and_update_user(slsx_client: OAuth2ConfigSLSx, request):
6968
# If the lookup for the requested version fails, raise the exception
7069
# This is wrapped in the case that if the requested version fails, match_fhir_id
7170
# will still bubble up UpstreamServerException
72-
for supported_version in FHIR_ID_VERSIONS_TO_CHECK:
71+
for supported_version in Versions.latest_versions():
7372
try:
7473
fhir_id, hash_lookup_type = match_fhir_id(
7574
mbi=slsx_client.mbi,

apps/testclient/tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ def test_offset_math(self):
279279
# our control, then these unit tests will always be suspect (including offsets and pagination values).
280280
# This seems to have been the case 7mo ago with the "total" test, above.
281281
# self.assertEqual(len(response_data["entry"]), 7)
282-
self.assertEqual(len(response_data["entry"]), 5)
282+
# From commit f6d4d7dcc91cea27288d4bc280cf0c395c60e6be, there was a change to 12 here.
283+
# The changes in that commit are around the logging of fhir_id_v2/fhir_id_v3.
284+
self.assertEqual(len(response_data["entry"]), 12)
283285
previous_links = [
284286
data["url"]
285287
for data in response_data["link"]
@@ -292,7 +294,7 @@ def test_offset_math(self):
292294
data["url"] for data in response_data["link"] if data["relation"] == "first"
293295
]
294296
self.assertEqual(len(previous_links), 1)
295-
self.assertEqual(len(next_links), 0)
297+
self.assertEqual(len(next_links), 1)
296298
self.assertEqual(len(first_links), 1)
297299
self.assertIn("startIndex=13", previous_links[0])
298300
self.assertIn("startIndex=0", first_links[0])

apps/versions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def as_int(version: int) -> int:
4040
def supported_versions():
4141
return [Versions.V1, Versions.V2, Versions.V3]
4242

43+
def latest_versions():
44+
return [Versions.V2, Versions.V3]
45+
4346

4447
class AccessType:
4548
ONE_TIME = 'ONE_TIME'

0 commit comments

Comments
 (0)