Created
June 9, 2021 12:29
-
-
Save velotiotech/0629c74e5665aad72c18b1d83d7a95e8 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 Product | |
@pytest.fixture(params=("ABC123", "123456", "ABCDEF")) | |
def product_one(db,request): | |
return Product.objects.create(name="Book 1",sku=request.param) | |
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