mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 23:55:46 +02:00
Rename database fixture
This commit is contained in:
parent
665d677941
commit
9abe5dd519
11 changed files with 162 additions and 179 deletions
|
|
@ -1,28 +1,24 @@
|
|||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from database.models import UforaCourse
|
||||
from database.utils.caches import UforaCourseCache
|
||||
|
||||
|
||||
async def test_ufora_course_cache_refresh_empty(database_session: AsyncSession, ufora_course_with_alias: UforaCourse):
|
||||
async def test_ufora_course_cache_refresh_empty(postgres, ufora_course_with_alias: UforaCourse):
|
||||
"""Test loading the data for the Ufora Course cache when it's empty"""
|
||||
cache = UforaCourseCache()
|
||||
await cache.refresh(database_session)
|
||||
await cache.refresh(postgres)
|
||||
|
||||
assert len(cache.data) == 1
|
||||
assert cache.data == ["test"]
|
||||
assert cache.aliases == {"alias": "test"}
|
||||
|
||||
|
||||
async def test_ufora_course_cache_refresh_not_empty(
|
||||
database_session: AsyncSession, ufora_course_with_alias: UforaCourse
|
||||
):
|
||||
async def test_ufora_course_cache_refresh_not_empty(postgres, ufora_course_with_alias: UforaCourse):
|
||||
"""Test loading the data for the Ufora Course cache when it's not empty anymore"""
|
||||
cache = UforaCourseCache()
|
||||
cache.data = ["Something"]
|
||||
cache.data_transformed = ["something"]
|
||||
|
||||
await cache.refresh(database_session)
|
||||
await cache.refresh(postgres)
|
||||
|
||||
assert len(cache.data) == 1
|
||||
assert cache.data == ["test"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue