Skip to content

Commit 916de16

Browse files
Cleanup: Remove/add some TODOs
1 parent 5c35c40 commit 916de16

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

apps/core/models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
from waffle.models import AbstractUserFlag
2-
# from django.db import models
32

43

54
class Flag(AbstractUserFlag):
65
""" Custom version of waffle feature Flag model """
76
""" This makes future extensions nicer """
8-
# Added as part of BB2-4250 testing
9-
# objects = models.Manager()
107

118
def is_active_for_user(self, user):
129
# use app_user which is the owner of the current app

apps/dot_ext/tests/test_authorization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def test_permission_denied_raised_for_authorize_app_not_in_flag(
10381038
# when the validate_v3_authorization_request of AuthorizationView function is called
10391039
# when the v3_early_adopter flag is not active for an application_user
10401040
# set up a fake request
1041+
# TODO: When we enable v3 endpoints for all applications, remove this test
10411042
query_params = urlencode({'client_id': 'FAKE_CLIENT_ID'})
10421043
request = HttpRequest()
10431044
request.META['QUERY_STRING'] = query_params
@@ -1081,9 +1082,10 @@ def test_permission_denied_raised_for_refresh_token_app_not_in_flag(
10811082
mock_get_application_model,
10821083
mock_get_user_model
10831084
):
1084-
# Unit test to show that we will raise an PermissionDenied
1085+
# BB2-4250Unit test to show that we will raise an PermissionDenied
10851086
# when the validate_v3_token_call of TokenView function is called
10861087
# when the v3_early_adopter flag is not active for an application_user
1088+
# TODO: When we enable v3 endpoints for all applications, remove this test
10871089
token_value = 'FAKE_REFRESH_TOKEN'
10881090
body = urlencode({'refresh_token': token_value}).encode('utf-8')
10891091
request = HttpRequest()

apps/fhir/bluebutton/views/generic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def initial(self, request, resource_type, *args, **kwargs):
9696
if "HTTP_AUTHORIZATION" in req_meta:
9797
access_token = req_meta["HTTP_AUTHORIZATION"].split(" ")[1]
9898
try:
99-
# TODO-4250 is this a place we need a flag check as well?
10099
at = AccessToken.objects.get(token=access_token)
101100
log_message = {
102101
"name": "FHIR Endpoint AT Logging",

apps/fhir/bluebutton/views/read.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def initial(self, request, *args, **kwargs):
3737
return super().initial(request, self.resource_type, *args, **kwargs)
3838

3939
def get(self, request, *args, **kwargs):
40-
# 4250-TODO: Do we check for the flag here as well? Implement the same thing in search? In case of refresh token?
4140
return super().get(request, self.resource_type, *args, **kwargs)
4241

4342
def build_parameters(self, *args, **kwargs):

apps/integration_tests/integration_test_fhir_resources.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,42 +768,48 @@ def _err_response_caused_by_illegalarguments(self, v2=False):
768768
@override_switch('v3_endpoints', active=True)
769769
def test_patient_read_endpoint_v3_403(self):
770770
'''
771-
test patient read and search v2
771+
test patient read v3 throwing a 403 when an app is not in the flag
772+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
772773
'''
773774
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_PATIENT, settings.DEFAULT_SAMPLE_FHIR_ID_V3, False, None)
774775

775776
@override_switch('v3_endpoints', active=True)
776777
def test_coverage_read_endpoint_v3_403(self):
777778
'''
778-
test patient read and search v2
779+
test coverage read v3 throwing a 403 when an app is not in the flag
780+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
779781
'''
780782
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_COVERAGE, 'part-a-99999999999999', False, None)
781783

782784
@override_switch('v3_endpoints', active=True)
783785
def test_eob_read_endpoint_v3_403(self):
784786
'''
785-
test patient read and search v2
787+
test eob read v3 throwing a 403 when an app is not in the flag
788+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
786789
'''
787790
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_EOB, 'outpatient--9999999999999', False, None)
788791

789792
@override_switch('v3_endpoints', active=True)
790793
def test_patient_search_endpoint_v3_403(self):
791794
'''
792-
test patient read and search v2
795+
test patient search v3 throwing a 403 when an app is not in the flag
796+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
793797
'''
794798
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_PATIENT, settings.DEFAULT_SAMPLE_FHIR_ID_V3, True, '_id=')
795799

796800
@override_switch('v3_endpoints', active=True)
797801
def test_coverage_search_endpoint_v3_403(self):
798802
'''
799-
test patient read and search v2
803+
test coverage search v3 throwing a 403 when an app is not in the flag
804+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
800805
'''
801806
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_COVERAGE, settings.DEFAULT_SAMPLE_FHIR_ID_V3, True, 'beneficiary=')
802807

803808
@override_switch('v3_endpoints', active=True)
804809
def test_eob_search_endpoint_v3_403(self):
805810
'''
806-
test patient read and search v2
811+
test eob search v3 throwing a 403 when an app is not in the flag
812+
TODO - Should be removed when v3_early_adopter flag is deleted and v3 is available for all apps
807813
'''
808814
self._call_v3_endpoint_to_assert_403(FHIR_RES_TYPE_EOB, settings.DEFAULT_SAMPLE_FHIR_ID_V3, True, 'patient=')
809815

0 commit comments

Comments
 (0)