Tuesday, October 3, 2023

Re: Reference data while testing

Thank you but unfortunately, none of the suggestions are appropriate. Here is more information.

We have a complex system where - in the opinion of a chemical expert - it is possible to state that a particular chemical risk profile has been correctly calculated by the software.

In addition to molecular properties, base and comparison information used bythe software to perform those risk calculations - at multiple end-points - is imported from many international regulatory authorities and stored in (Django/Postgres) reference tables. There are hundreds of thousands of records all of which are (somewhat) regularly updated when those authorities notify changes.

Once an expert confirms a risk profile for a particular chemical we use a Django management command to generate a new Django test in our test harness. The objective is to run that/those tests in our regular testing regime to prove the software - and reference data - is still OK.

If the reference data or the software changes, we want to discover any discrepancies from the expert opinion.

Automating creation of those tests (underpinning the expert opinion) is important because it is the only way I can see to stay sane. I am not a chemical expert.

I was hoping someone could suggest a way - perhaps using dbalias - to allow read-only use of the reference portion of the database. Another thought I had was to load a dump of the reference data prior to starting the tests but I believe Django would simply wipe that after the first test.

Factory boy is really good but cannot provide accurate reference information. I can see SQLAlchemy might be a solution but I'd prefer to stay within Django/Postgres.

Still looking ...

Thanks

On 4/10/2023 5:26 am, Alessandro Madruga Correia wrote:


On Mon, Oct 2, 2023 at 11:30 PM Mike Dewhirst <miked@dewhirst.com.au> wrote:

This is probably in the docs so please drop me a link if you can.

My project has fifteen or more tables of reference data which determine how the software behaves and therefore is critical to unit testing.

Fixtures are unworkable and I  need to respond to the actual reference data.

How can i do real lookups (read-only) during tests?



--
  ,= ,-_-. =.   [<o>] Alessandro Madruga Correia
 ((_/)o o(\_))  [http://counter.li.org]       Debian User# 342751 
   `-'(. .)`-'    "O fanatismo é a única forma de força de vontade 
       \_/        acessível aos fracos." (Friedrich Nietzsche)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOofabfi%3DErk535OgDo5nPU%3DwM1pVp%3D93muppuGMt1c6M2vSZA%40mail.gmail.com.


--   Signed email is an absolute defence against phishing. This email has  been signed with my private key. If you import my public key you can  automatically decrypt my signature and be sure it came from me. Your  email software can handle signing.  

No comments:

Post a Comment