API: Fix test for deleting tax rules

This commit is contained in:
Raphael Michel
2017-10-11 10:56:07 +02:00
parent 3f8df0f036
commit de086a2b07
2 changed files with 4 additions and 4 deletions

View File

@@ -161,7 +161,7 @@ Endpoints
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/ .. http:patch:: /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/
Update a tax rule. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of Update a tax rule. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be resetted to defaukt. With ``PATCH``, you only need to provide the fields that you the resource, other fields will be resetted to default. With ``PATCH``, you only need to provide the fields that you
want to change. want to change.
**Example request**: **Example request**:

View File

@@ -74,8 +74,8 @@ def test_rule_delete(token_client, organizer, event, taxrule):
resp = token_client.delete( resp = token_client.delete(
'/api/v1/organizers/{}/events/{}/taxrules/{}/'.format(organizer.slug, event.slug, taxrule.pk), '/api/v1/organizers/{}/events/{}/taxrules/{}/'.format(organizer.slug, event.slug, taxrule.pk),
) )
assert resp.status_code == 200 assert resp.status_code == 204
assert not event.taxrules.exists() assert not event.tax_rules.exists()
@pytest.mark.django_db @pytest.mark.django_db
@@ -85,4 +85,4 @@ def test_rule_delete_forbidden(token_client, organizer, event, taxrule):
'/api/v1/organizers/{}/events/{}/taxrules/{}/'.format(organizer.slug, event.slug, taxrule.pk), '/api/v1/organizers/{}/events/{}/taxrules/{}/'.format(organizer.slug, event.slug, taxrule.pk),
) )
assert resp.status_code == 403 assert resp.status_code == 403
assert event.taxrules.exists() assert event.tax_rules.exists()