예제 #1
0
 def category_init_func(row):
     c = Category()
     c.id = row['id']
     c.name = row['name']
     c.description = row['description']
     return c
예제 #2
0
    def test_forum(self):
        category = Category()
        category.name = "Main Category"
        category.id = 1

        db.session.add(category)
예제 #3
0
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",
    }