lundi 22 juin 2015

Disable caching querysets for tests

I have view with few defined filter backends. And in tests necessary to check, how API is work (correctly or not). But in my tests cases, I'm getting assertion errors, because actual and expected results are different. After spending a lot of time for debugging, I'm found a issue – querysets are caching. For the first test its enough, but in another test-cases my objects have another IDs/PKs (cause update some attributes/foreign keys/etc.)
How can I disable cache mechanism for querysets in tests? Or maybe existing other ways to solve?

Aucun commentaire:

Enregistrer un commentaire