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

        db.session.add(category)
Exemplo n.º 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",
    }