home
join about login
gst

Nov. 12, 2017, 2:38 a.m.

How to disable cache during django tests

usually we don't want cache working while on tests
I do like this, in settings.py :

 CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'unique-snowflake',
},
}

TEST_CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}

then in the tests, being in before a class or function, do this :
 @override_settings(CACHES=settings.TEST_CACHES)
def function(........):
do something

3505 views origin
Los candidatos se disputan el poderoso voto del magisterio mexica - Trump quip about North Korea's Kim sparks outcry on social media - Austria plans tougher sentences for crimes against women - Dieguito - A Lesma © ℗ MÚSICA AUTORAL Ensaio - GLORIA GROOVE - SEDANAPO - Federer pummels Bemelmans to move closer to top spot - Tonella - revisão do limpador de parabrisa do fusca - NASA Awards Contract for Continued Operations of its Jet Propulsi - At Tranquility Base - gliptodonte encontrado en Picada Varela - Pipi das Meias Altas Portuguese vol 1 - The Extraordinary Spiral in LL Pegasi - Cetus Galaxies and Supernova - Southern California as Seen From Apollo 7 - Newest Crew Launches for the International Space Station - Orion in Red and Blue - Major League Baseball notebook: Mariners deal for Colome, Span fr - This is how to train a cat :D How I Trained My Cat - Fallece un exdiputado federal del PRI tiroteado este fin de seman - Celebrating 28 Years of the Hubble Space Telescope - Eu vi eu viiiii O papai noel tava na sinaleira - Wozniacki passes Barty test in Madrid, Sharapova advances - Guri de Uruguaiana fala sobre hits do Carnaval e exageros no Phot - Exclusive: North Korea earned $200 million from banned exports, s - amizades - Launching to Observe Our Sun - NASA Awards Contract for Aerospace Systems Modeling, Simulation - Slava Ukraini! on Steam - Eclipse solar hoje! - Climate change: 'Hothouse Earth' risks even if CO2 emissions slas - Little Planet Soyuz - Noel Guarany | Sem Fronteira (1975) [Álbum Completo/Full Album] -  

tutti - social network

Tutti is the simplest social network on internet. Here you can make friends, create communities, sell things, make surveys, comment and share stuff.

more