Procedure for setting up mysql/mariaadb triggers, stored procedures & views (only once) for all django TestCase unittests

23 Views Asked by At

A procedure for setting up mysql/mariaadb triggers, stored procedures & views for all (prior to running) unittests (see refs below).

I've searched the django docs and other resource but can not find a solution.

The 'python manage.py test' execution should, in some setup stage, run DB statements (create views & triggers and stored procedures) before any unittest execution. The db statements need to persist across all unittest. Basically. setting up a database once before any unittests are run and maintaining that state throughout the entire setup/buildup/tear-down unittest methods and transaction resets.

These DB statements are generated by the (mysql/mariadb)dbdump binary program so they are essentailly SQL statements. All the required statements could be in a single or multiple (mysql/mariadb)dbdump files.

some previous questions for reference in case I'm missing something (trimmed to most relevant as I've spent some time researching this): What's the best way to load stored procedures into the Django unit test database? How to setup and teardown temporary django db for unit testing? How can I keep test data after Django tests complete?

If you could at least point me to something relevant I'll gladly take it from there.

TIA and appreciate any assistance!

0

There are 0 best solutions below