Skip to content

Commit d83f540

Browse files
authored
fix: remove event_stream_type from the payload when creating/updating event streams (#1092)
1 parent ee2bc4f commit d83f540

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

src/aap_eda/api/serializers/event_stream.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class Meta:
6363
"additional_data_headers",
6464
"eda_credential_id",
6565
"organization_id",
66-
"event_stream_type",
6766
]
6867

6968

tests/integration/api/test_event_stream.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -147,34 +147,6 @@ def test_update_event_stream(
147147
)
148148

149149

150-
@pytest.mark.django_db
151-
def test_update_event_stream_with_mismatched_type(
152-
admin_client: APIClient,
153-
default_hmac_credential: models.EdaCredential,
154-
default_organization: models.Organization,
155-
default_event_stream: models.EventStream,
156-
):
157-
invalid_event_stream_type = "mismatched_type"
158-
data_in = {
159-
"name": "new_test_event_stream",
160-
"event_stream_type": invalid_event_stream_type,
161-
}
162-
with override_settings(
163-
EVENT_STREAM_BASE_URL="https://www.example.com/",
164-
):
165-
response = admin_client.patch(
166-
f"{api_url_v1}/event-streams/{default_event_stream.id}/",
167-
data=data_in,
168-
)
169-
assert response.status_code == status.HTTP_400_BAD_REQUEST
170-
assert (
171-
f"The input event stream type {invalid_event_stream_type} does "
172-
"not match with the credential type "
173-
f"{default_hmac_credential.credential_type.kind}"
174-
in response.data["non_field_errors"]
175-
)
176-
177-
178150
@pytest.mark.django_db
179151
def test_create_event_stream_without_credentials(
180152
admin_client: APIClient, default_organization: models.Organization
@@ -190,34 +162,6 @@ def test_create_event_stream_without_credentials(
190162
}
191163

192164

193-
@pytest.mark.django_db
194-
def test_create_event_stream_with_mismatched_types(
195-
admin_client: APIClient,
196-
default_organization: models.Organization,
197-
default_hmac_credential: models.EdaCredential,
198-
):
199-
invalid_event_stream_type = "invalid_type"
200-
data_in = {
201-
"name": "test_es",
202-
"event_stream_type": invalid_event_stream_type,
203-
"eda_credential_id": default_hmac_credential.id,
204-
"organization_id": default_organization.id,
205-
}
206-
with override_settings(
207-
EVENT_STREAM_BASE_URL="https://www.example.com/",
208-
):
209-
response = admin_client.post(
210-
f"{api_url_v1}/event-streams/", data=data_in
211-
)
212-
assert response.status_code == status.HTTP_400_BAD_REQUEST
213-
assert (
214-
f"The input event stream type {invalid_event_stream_type} does "
215-
"not match with the credential type "
216-
f"{default_hmac_credential.credential_type.kind}"
217-
in response.data["non_field_errors"]
218-
)
219-
220-
221165
@pytest.mark.django_db
222166
def test_delete_event_stream(
223167
admin_client: APIClient,

0 commit comments

Comments
 (0)