Closed rgaudin closed 2 years ago
@rgaudin can you tell me more about how I should design the demo. Can it be a single script that generates a test database?
Like "invoke seed-test-DB"
A command like invoke load-demo-fixture
that would do something like ensure it can be imported (using sys.path if required) and from backend_demo import load_fixture()
That function being something like:
def load_fixture():
book = Book(id="xxxx", ...)
title = Title(...)
The idea is that the fixture should be code that can be run and versioned. Simple model instance creation, like in the tests. We don't want something complicated ; just enough data for the UI to be tested without real data.
We'd want it outside our backend
module as this is not useful code and we don't want to test/cover it.
Realized the titles in the fixture have no data. Those are just linked to books but there is no metadata/language/tags n the titles, making them unusable and thus preventing us from testing UI properly
@rgaudin understood, fixing it now!
In order to test UI, we need to have sample data: books, titles, with their tags and metadata.
This can be static model use within a dedicated
backend.demo
module that gets called using an invoke task.