1562 | | .. note:: |
1563 | | |
1564 | | When overriding settings, make sure to handle the cases in which your app's |
1565 | | code uses a cache or similar feature that retains state even if the |
1566 | | setting is changed. Django provides the |
1567 | | :data:`django.test.signals.setting_changed` signal that lets you register |
1568 | | callbacks to clean up and otherwise reset state when settings are changed. |
1569 | | Note that this signal isn't currently used by Django itself, so changing |
1570 | | built-in settings may not yield the results you expect. |
| 1562 | When overriding settings, make sure to handle the cases in which your app's |
| 1563 | code uses a cache or similar feature that retains state even if the |
| 1564 | setting is changed. Django provides the |
| 1565 | :data:`django.test.signals.setting_changed` signal that lets you register |
| 1566 | callbacks to clean up and otherwise reset state when settings are changed. |
| 1567 | |
| 1568 | Django itself uses this signal to reset various data: |
| 1569 | |
| 1570 | =========================== ======================== |
| 1571 | Overriden settings Data reset |
| 1572 | =========================== ======================== |
| 1573 | USE_TZ, TIME_ZONE Databases timezone |
| 1574 | TEMPLATE_CONTEXT_PROCESSORS Context processors cache |
| 1575 | SERIALIZATION_MODULES Serializers cache |
| 1576 | LOCALE_PATHS, LANGUAGE_CODE Default translation and loaded translations |
| 1577 | =========================== ======================== |