Monday, March 29, 2021

How to properly document and test models with natural keys

Hello,

I'm thinking about adding natural keys to a lot of existing models (Djano 3.1.7) to help initializing dev or prod database.

1. How best to unit test  models using natural keys ?
I was thinking of separately testing  both serialization and deserialization but would be very curious to learn about examples or alternatives, specifically when Foerign key relations existe between models.

2. For any unit test, you may have to hand write a YAML sample.
How is it best to write this sample ?

3. Suggestions. Recommendations. Pointers ?

Best regards

--
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/16edd7f9-d32e-4d58-bf2d-0a0f9d28087bn%40googlegroups.com.

No comments:

Post a Comment