0

I'm using redis as my cache server. When a user created , the post_save signal will save his information in redis with key="user_info_<userid>". However, when I run the unit test and create the user, the information will be overwritten. How can I prevent this. How can I change the cache storage when testing?

ramwin
  • 5,803
  • 3
  • 27
  • 29
  • Every comments may be helpfull. Please leave your opinion, thankyou. – ramwin Jun 12 '18 at 03:12
  • use code to disable you redis cache service before you test code – Ykh Jun 12 '18 at 03:17
  • 1
    [This](https://stackoverflow.com/questions/913549/how-to-unit-test-with-different-settings-in-django) may help you – Ykh Jun 12 '18 at 03:22
  • Thank you Ykh. That is really helpful. I will test and discuss the solutions in that question. – ramwin Jun 12 '18 at 03:41
  • Possible duplicate of [How to Unit test with different settings in Django?](https://stackoverflow.com/questions/913549/how-to-unit-test-with-different-settings-in-django) – ramwin Jun 12 '18 at 03:45

0 Answers0