def test_factory(self, db): wiki_group = WikiGroupFactory.create() retrieved = WikiGroup.get_by_id(wiki_group.id) assert retrieved.id == 1 assert retrieved.name == 'wiki group 1' assert retrieved.db_name == 'wikigroup1' assert retrieved.active == True
def test_delete_and_in(self, db): with db.atomic(): for i in range(3): WikiGroupFactory.create() WikiGroup.delete().where(WikiGroup.id.in_([1,2])).execute() assert WikiGroup.select().count() == 1 assert WikiGroup.get_by_id(3)
def test_DoesNotExist(self, db): with pytest.raises(WikiGroup.DoesNotExist): WikiGroup.get_by_id(10)