Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2021 12:27
What would you like to do?
from product.models import Category
def test_filter_category(db):
assert Category.objects.filter(name="Books").exists()
def test_update_category(db):
category = Category.objects.create(name="Books") = "DVDs"
category_from_db = Category.objects.get(name="DVDs")
assert == "DVDs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment