Skip to content

How to create test databases and connect them to the test Sanic app? #68

@Maksim-Burtsev

Description

@Maksim-Burtsev

I am trying to test app with TortoiseORM and i dont understand what is the right way to setup my test application in fixture.

I was tried to make with listeners and fixtures but i am always how problems with event loop, or tortoise can't connect to the database, or fixture doesnt work and etc. And i can't find any example on stackoverflow/github with testing Sanic with tortoise and test databases.

Can you show me the best way to setup tests for testing Sanic & TortoiseORM on the test db (e.g. sqlite) ?

p.s I think i can use sqlite:///:memory for

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions