def category_init_func(row): c = Category() c.id = row['id'] c.name = row['name'] c.description = row['description'] return c
def test_forum(self): category = Category() category.name = "Main Category" category.id = 1 db.session.add(category)
import pytest from app.models import Category test_category = Category() test_category.id = 1 test_category.name = "name" def test_to_dic(): assert test_category.to_dict() == { "id": 1, "name": "name", }