You've already forked hotpocket
BTHLABS-61: Service layer refactoring
A journey to fix `ValidationError` in Pocket imports turned service layer refactoring :D
This commit is contained in:
@@ -47,10 +47,10 @@ def test_ok(authenticated_client: Client,
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_invalid_all_empty(authenticated_client: Client,
|
||||
association_out,
|
||||
payload,
|
||||
):
|
||||
def test_all_empty(authenticated_client: Client,
|
||||
association_out,
|
||||
payload,
|
||||
):
|
||||
# Given
|
||||
effective_payload = {
|
||||
key: ''
|
||||
@@ -79,9 +79,9 @@ def test_invalid_all_empty(authenticated_client: Client,
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_invalid_all_missing(authenticated_client: Client,
|
||||
association_out,
|
||||
):
|
||||
def test_all_missing(authenticated_client: Client,
|
||||
association_out,
|
||||
):
|
||||
# Given
|
||||
effective_payload = {}
|
||||
|
||||
@@ -105,6 +105,45 @@ def test_invalid_all_missing(authenticated_client: Client,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_archived(authenticated_client: Client,
|
||||
archived_association_out,
|
||||
):
|
||||
# When
|
||||
result = authenticated_client.post(
|
||||
reverse('ui.associations.edit', args=(archived_association_out.pk,)),
|
||||
)
|
||||
|
||||
# Then
|
||||
assert result.status_code == http.HTTPStatus.NOT_FOUND
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_deleted(authenticated_client: Client,
|
||||
deleted_association_out,
|
||||
):
|
||||
# When
|
||||
result = authenticated_client.post(
|
||||
reverse('ui.associations.edit', args=(deleted_association_out.pk,)),
|
||||
)
|
||||
|
||||
# Then
|
||||
assert result.status_code == http.HTTPStatus.NOT_FOUND
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_not_found(authenticated_client: Client,
|
||||
null_uuid,
|
||||
):
|
||||
# When
|
||||
result = authenticated_client.post(
|
||||
reverse('ui.associations.edit', args=(null_uuid,)),
|
||||
)
|
||||
|
||||
# Then
|
||||
assert result.status_code == http.HTTPStatus.NOT_FOUND
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_other_account_association(authenticated_client: Client,
|
||||
other_account_association_out,
|
||||
|
||||
Reference in New Issue
Block a user