V
V
Vic Shostak2018-01-24 00:20:49
React
Vic Shostak, 2018-01-24 00:20:49

Django + Pytest + Mock. How to write a test that checks the current Redis cache for a value?

Good time of the year.
I'm learning to write tests with mocks for Django (Python 3.6, for storing the Redis cache), so please don't kick too hard for a noob question. How can I write a test that mocks a function (which in turn is used to generate a key-value that is stored in the cache) checks the current cache for a value? If it matches, then the test passes.
I would be glad if you provide useful links to tutorial articles/videos about tests with mocks for complete dummies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
g_s_e, 2019-11-08
@g_s_e

It does not see arr, most likely you need to
replace it with this
const { posts, userMoney, model } = this.state;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question