Skip to content

Commit

Permalink
Apply black formatting to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cj committed Feb 13, 2023
1 parent 04c097a commit 8d4f368
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions tests/routes/v1/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ def test_campaigns(client):


def test_create_campaign_unique_constraint(client, campaign):

payload = {"name": campaign["name"], "description": "foo"}
response = client.post("/api/v1/campaigns", json=payload)
assert response.status_code == 400
assert response.json() == {"detail": "A campaign already exists with that name"}


def test_edit_campaign_unique_constraint(client, campaign):

campaign_2 = {"name": "foo", "description": "bar"}
response = client.post("/api/v1/campaigns", json=campaign_2)
assert response.status_code == 201
Expand Down
4 changes: 0 additions & 4 deletions tests/routes/v1/test_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


def test_create_edit(client):

# create
payload = {
"name": "cj",
Expand Down Expand Up @@ -45,7 +44,6 @@ def test_create_edit(client):

@pytest.mark.parametrize("field", ["email", "phone"])
def test_create_unique_constraint(client, customer_cj, field):

payload = {"name": "foo", field: customer_cj[field]}
response = client.post("/api/v1/customers", json=payload)
assert response.status_code == 400
Expand All @@ -54,7 +52,6 @@ def test_create_unique_constraint(client, customer_cj, field):

@pytest.mark.parametrize("field", ["email", "phone"])
def test_edit_unique_constraint(client, customer_cj, customer_sarah, field):

payload = customer_cj
del payload["date_created"]
del payload["date_modified"]
Expand All @@ -67,7 +64,6 @@ def test_edit_unique_constraint(client, customer_cj, customer_sarah, field):


def test_get(client, customer_cj, customer_sarah, customer_sarah_2):

# get by id
response = client.get(f'/api/v1/customers/{customer_cj["id"]}')
assert response.status_code == 200
Expand Down
4 changes: 0 additions & 4 deletions tests/routes/v1/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def test_categories(client):

# create
payload = {"name": "Cocoa Bomb", "description": "Chocolate milk bomb"}
date_created = datetime.now(timezone.utc)
Expand Down Expand Up @@ -50,15 +49,13 @@ def test_categories(client):


def test_create_category_unique_constraint(client, menu_category):

payload = {"name": menu_category["name"]}
response = client.post("/api/v1/menu/categories", json=payload)
assert response.status_code == 400
assert response.json() == {"detail": "A menu category already exists with that name"}


def test_edit_category_unique_constraint(client, menu_category):

category_2 = {"name": "foo"}
response = client.post("/api/v1/menu/categories", json=category_2)
assert response.status_code == 201
Expand All @@ -70,7 +67,6 @@ def test_edit_category_unique_constraint(client, menu_category):


def test_menu_items(client, menu_category):

# create
payload = {
"name": "Chocolate Cocoa Bomb",
Expand Down
1 change: 0 additions & 1 deletion tests/routes/v1/test_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def test_payments(client, order):

# create
payload = {
"order_id": order["id"],
Expand Down

0 comments on commit 8d4f368

Please sign in to comment.