jeudi 21 mai 2020

Skipping Django test database creation for read-only, externally managed, high-security, big databases

We need to use real data for one of our many external data sources during Django tests:

  • data is externally managed and read-only
  • data is accessed through manage.py inspectdb generated ORM classes
  • data is highly sensitive and we are not allowed to store fixtures of the actual data
  • tables are legacy design and will be phased out, hundreds of tables with complex relations, even getting a single record is complex
  • there is too much to do and I am unwilling to spend the time it would take to generate the fixtures, guarantee they're obfuscated, get approval of the obfuscation and justify keeping it around just to bridge us for a few months

We understand the downsides: This violates test purity and introduces a potential safety risk. We are willing to compromise on both to get us past the next few months when we will phase out this problem data source.

In this case, I need Django to understand that I don't want it to stand up a test database for this source, and just use the actual source so we can run some quick checks and walk away.

What is the simplest way to achieve this, with full understanding and acceptance of the risks and recommendations against?

Aucun commentaire:

Enregistrer un commentaire