Skip to content

Commit

Permalink
BB2-2885 New SBX apps now default to 13-months (#1154)
Browse files Browse the repository at this point in the history
* BB2-2885 New SBX apps now default to 13-months

* BB2-2885 Fix failing test
  • Loading branch information
ajshred authored Dec 21, 2023
1 parent 58642ac commit c31682e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_revoked_data_access_grant_without_flag_limit_data_access(self):
)

# 2. Test application data access type
self.assertEqual(app.data_access_type, "ONE_TIME")
self.assertEqual(app.data_access_type, "THIRTEEN_MONTH")

# 3. Test grant obj created OK.
dag = DataAccessGrant.objects.get(beneficiary=user, application=app)
Expand Down
2 changes: 1 addition & 1 deletion apps/dot_ext/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Application(AbstractApplication):

# Type related to data access limits.
data_access_type = models.CharField(
default="ONE_TIME",
default="THIRTEEN_MONTH",
choices=APPLICATION_TYPE_CHOICES,
max_length=16,
null=True,
Expand Down
2 changes: 1 addition & 1 deletion apps/dot_ext/tests/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def test_refresh_with_one_time_access_retrieve_app_from_auth_header(self):
data=refresh_request_data,
HTTP_AUTHORIZATION=auth,
)
self.assertEqual(response.status_code, 401)
self.assertEqual(response.status_code, 400)

def test_refresh_with_revoked_token(self):
redirect_uri = 'http://localhost'
Expand Down
8 changes: 4 additions & 4 deletions apps/dot_ext/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_application_data_access_fields(self):

# Create defaults
test_app = self._create_application("test_app", user=dev_user)
self.assertEqual("ONE_TIME", test_app.data_access_type)
self.assertEqual("THIRTEEN_MONTH", test_app.data_access_type)

# Delete app
test_app.delete()
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_application_data_access_type_change(self):

# Create defaults
test_app = self._create_application("test_app", user=dev_user)
self.assertEqual("ONE_TIME", test_app.data_access_type)
self.assertEqual("THIRTEEN_MONTH", test_app.data_access_type)

# fake some grants tied to the user and the app
DataAccessGrant.objects.update_or_create(
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_application_data_access_type_change(self):
self.assertEqual(len(log_entries), 1)
log_entry_json = json.loads(log_entries[0])
self.assertEqual(log_entry_json['type'], "application_data_access_type_change")
self.assertEqual(log_entry_json['data_access_type_old'], "ONE_TIME")
self.assertEqual(log_entry_json['data_access_type_old'], "THIRTEEN_MONTH")
self.assertEqual(log_entry_json['data_access_type_new'], "RESEARCH_STUDY")

@override_flag('limit_data_access', active=False)
Expand All @@ -125,7 +125,7 @@ def test_application_data_access_type_change_switch_off(self):

# Create defaults
test_app_sw_off = self._create_application("test_app_sw_off", user=dev_user)
self.assertEqual("ONE_TIME", test_app_sw_off.data_access_type)
self.assertEqual("THIRTEEN_MONTH", test_app_sw_off.data_access_type)

# fake some grants tied to the user and the app
DataAccessGrant.objects.update_or_create(
Expand Down
2 changes: 1 addition & 1 deletion apps/logging/tests/audit_logger_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"auth_client_id": {"type": "string"},
"auth_app_id": {"pattern": "^1$"},
"auth_app_name": {"pattern": "an app"},
"auth_app_data_access_type": {"pattern": "ONE_TIME"},
"auth_app_data_access_type": {"pattern": "THIRTEEN_MONTH"},
"auth_pkce_method": {"type": "null"},
"auth_share_demographic_scopes": {"pattern": "^$"},
"auth_require_demographic_scopes": {"pattern": "^True$"},
Expand Down
8 changes: 4 additions & 4 deletions apps/logging/tests/test_loggers_management_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def test_management_command_logging(self):
"token_table_count": 8,
"token_archived_table_count": 0,
"user_limit_data_access": [True],
"data_access_type": ["ONE_TIME"],
"data_access_type": ["THIRTEEN_MONTH"],
}
}
)
Expand All @@ -551,7 +551,7 @@ def test_management_command_logging(self):
"token_table_count": 7,
"token_archived_table_count": 0,
"user_limit_data_access": [True],
"data_access_type": ["ONE_TIME"],
"data_access_type": ["THIRTEEN_MONTH"],
}
}
)
Expand Down Expand Up @@ -629,7 +629,7 @@ def test_management_command_logging(self):
"token_table_count": 2,
"token_archived_table_count": 0,
"user_limit_data_access": [True],
"data_access_type": ["ONE_TIME"],
"data_access_type": ["THIRTEEN_MONTH"],
}
}
)
Expand Down Expand Up @@ -872,7 +872,7 @@ def test_management_command_logging(self):
"token_table_count": 17,
"token_archived_table_count": 0,
"user_limit_data_access": [True],
"data_access_type": ["ONE_TIME"],
"data_access_type": ["THIRTEEN_MONTH"],
}
}
)
Expand Down

0 comments on commit c31682e

Please sign in to comment.