Fixture for TestTSVectorField. Uses models defined in tests.contrib.postgres.models_tsvector module. Equivalent to: test.IsolatedTestCase with tortoise_test_modules
()
| 62 | |
| 63 | @pytest_asyncio.fixture(scope="function") |
| 64 | async def db_tsvector(): |
| 65 | """ |
| 66 | Fixture for TestTSVectorField. |
| 67 | |
| 68 | Uses models defined in tests.contrib.postgres.models_tsvector module. |
| 69 | Equivalent to: test.IsolatedTestCase with tortoise_test_modules |
| 70 | """ |
| 71 | skip_if_not_postgres() |
| 72 | db_url = os.getenv("TORTOISE_TEST_DB", "sqlite://:memory:") |
| 73 | async with tortoise_test_context( |
| 74 | modules=["tests.contrib.postgres.models_tsvector"], |
| 75 | db_url=db_url, |
| 76 | app_label="models", |
| 77 | connection_label="models", |
| 78 | ) as ctx: |
| 79 | yield ctx |
| 80 | |
| 81 | |
| 82 | @pytest_asyncio.fixture(scope="function") |
nothing calls this directly
no test coverage detected
searching dependent graphs…