Created
June 9, 2021 12:27
-
-
Save velotiotech/3f508a1a42372d86a3f7e3887ca1fea2 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
from product.models import Category | |
def test_filter_category(db): | |
Category.objects.create(name="Books") | |
assert Category.objects.filter(name="Books").exists() | |
def test_update_category(db): | |
category = Category.objects.create(name="Books") | |
category.name = "DVDs" | |
category.save() | |
category_from_db = Category.objects.get(name="DVDs") | |
assert category_from_db.name == "DVDs" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment