coins-demo/todo/tests/conftest.py
Scot Hacker f4d1da0ab7 Smoke and permissions tests
And various bug / permissions config tweaks to accompany
2018-03-26 00:37:29 -07:00

17 lines
623 B
Python

import pytest
from django.contrib.auth.models import Group
from todo.models import Item, TaskList
@pytest.fixture
def todo_setup(django_user_model):
g1 = Group.objects.create(name="Weavers")
u1 = django_user_model.objects.create(username="you", password="password")
u1.groups.add(g1)
tlist = TaskList.objects.create(group=g1, name="Zip", slug="zip")
Item.objects.create(created_by=u1, title="Task 1", task_list=tlist, priority=1)
Item.objects.create(created_by=u1, title="Task 2", task_list=tlist, priority=2)
Item.objects.create(created_by=u1, title="Task 3", task_list=tlist, priority=3)