()
| 669 | |
| 670 | @pytest.fixture() |
| 671 | def reset_cache(): # type: ignore[no-untyped-def] |
| 672 | # https://groups.google.com/g/django-developers/c/zlaPsP13dUY |
| 673 | # TL;DR: Use this if your test interacts with cache since django |
| 674 | # does not clear cache after every test |
| 675 | # Clear all caches before the test |
| 676 | for cache in caches.all(): |
| 677 | cache.clear() |
| 678 | |
| 679 | yield |
| 680 | |
| 681 | # Clear all caches after the test |
| 682 | for cache in caches.all(): |
| 683 | cache.clear() |
| 684 | |
| 685 | |
| 686 | @pytest.fixture() |