mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-31 06:15:49 +00:00
Approval up front checks (#755)
* up front approval conversions * with tests * fix approval func tests * address comments
This commit is contained in:
@@ -9,7 +9,7 @@ def test_approve_batch_change_with_invalid_batch_change_id_fails(shared_zone_tes
|
||||
|
||||
client = shared_zone_test_context.ok_vinyldns_client
|
||||
|
||||
error = client.reject_batch_change("some-id", status=404)
|
||||
error = client.approve_batch_change("some-id", status=404)
|
||||
assert_that(error, is_("Batch change with id some-id cannot be found"))
|
||||
|
||||
@pytest.mark.manual_batch_review
|
||||
@@ -19,10 +19,10 @@ def test_approve_batch_change_with_comments_exceeding_max_length_fails(shared_zo
|
||||
"""
|
||||
|
||||
client = shared_zone_test_context.ok_vinyldns_client
|
||||
reject_batch_change_input = {
|
||||
approve_batch_change_input = {
|
||||
"reviewComment": "a"*1025
|
||||
}
|
||||
errors = client.reject_batch_change("some-id", reject_batch_change_input, status=400)['errors']
|
||||
errors = client.approve_batch_change("some-id", approve_batch_change_input, status=400)['errors']
|
||||
assert_that(errors, contains_inanyorder("Comment length must not exceed 1024 characters."))
|
||||
|
||||
@pytest.mark.manual_batch_review
|
||||
@@ -42,7 +42,7 @@ def test_approve_batch_change_fails_with_forbidden_error_for_non_system_admins(s
|
||||
result = client.create_batch_change(batch_change_input, status=202)
|
||||
completed_batch = client.wait_until_batch_change_completed(result)
|
||||
to_delete = [(change['zoneId'], change['recordSetId']) for change in completed_batch['changes']]
|
||||
error = client.reject_batch_change(completed_batch['id'], status=403)
|
||||
error = client.approve_batch_change(completed_batch['id'], status=403)
|
||||
assert_that(error, is_("User does not have access to item " + completed_batch['id']))
|
||||
finally:
|
||||
clear_zoneid_rsid_tuple_list(to_delete, client)
|
||||
|
Reference in New Issue
Block a user