@pytest.mark.adapter
def test_v2_integration_update_dataset_notfound(
mock_v2_integration, dataset_with_foreign_keys, v2_integration_settings, requests_mock
):
matcher = re.compile(v2_integration_settings.METAX_V2_HOST)
requests_mock.register_uri("GET", matcher, status_code=404)
dataset_updated.send(sender=None, instance=dataset_with_foreign_keys)
assert requests_mock.call_count == 2
call = requests_mock.request_history[0]
assert call.method == "GET"
assert call.url == f"https://metax-v2-test/rest/v2/datasets/{dataset_with_foreign_keys.id}"
call = requests_mock.request_history[1]
assert call.method == "POST"
assert call.url == "https://metax-v2-test/rest/v2/datasets?migration_override"