C
C
Cross58202020-11-04 16:52:40
Django
Cross5820, 2020-11-04 16:52:40

TestCase, Cache or how to write a test to check the cache?

The situation is as follows:
I made a website, I write tests for it. News appears on the main page, the main page is cached in templates

{% load cache %}{% cache 20 index %}......{% endcache %}


how to write a test to check the page for the presence of the cache and its correct operation?

p.s. just learning to code

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander N, 2021-08-06
@WhiskyBar

There is a suspicion that this is a task from Yandex.Practice. If suddenly someone else is relevant, then in the next task they recommend doing this by deleting the entry: Delete the entry, check the availability of the entry on the page (from the cache), clear the cache and make sure that the entry has disappeared.

R
Rodion, 2020-11-04
@rodion4dev

The caching implementation is part of the Django framework; in my opinion, there is no need to test what is not written by you :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question