Created
June 9, 2021 12:28
-
-
Save velotiotech/9f7ebadfb806b79caa906d5f7f4a6c93 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 product_one(db): | |
return Product.objects.create(name="Book 1", sku="ABC123") | |
def test_product_sku(product_one): | |
assert all(letter.isalnum() for letter in product_one.sku) | |
assert len(product_one.sku) == 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment