Created
June 9, 2021 12:32
-
-
Save velotiotech/215a9f8ccd195df722cb15196471834e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from product.models import Category, Product | |
@pytest.fixture | |
def category(db) -> Category: | |
return Category.objects.create(name="Books") | |
@pytest.fixture | |
def product_one(db, category): | |
return Product.objects.create(name="Book 1", category=category) | |
@pytest.fixture | |
def product_two(db, category): | |
return Product.objects.create(name="Book 2", category=category) | |
def test_two_different_books_create(product_one, product_two): | |
assert product_one.pk != product_two.pk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment