Skip to content

Commit

Permalink
Use of fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
willianantunes committed Mar 6, 2019
1 parent 6bdaf51 commit 28fbd07
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/tests/integration/graphql/test_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
from api.models import Category


@pytest.mark.django_db
def test_should_create_category():
client = Client(schema)
@pytest.fixture
def client():
return Client(schema)


@pytest.mark.django_db
def test_should_create_category(client):
query = """
mutation createCategory($data: CategorySerializerMutationInput!){
createCategory(input: $data){
Expand All @@ -28,9 +31,7 @@ def test_should_create_category():


@pytest.mark.django_db
def test_should_create_ingredient():
client = Client(schema)

def test_should_create_ingredient(client):
fake_category_name = "fake_name_category"
fake_category = Category.objects.create(name=fake_category_name)

Expand Down

0 comments on commit 28fbd07

Please sign in to comment.