mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
18 lines
368 B
Python
18 lines
368 B
Python
|
|
"""Used by tests to ensure logging is kept when calling setup() twice."""
|
||
|
|
|
||
|
|
try:
|
||
|
|
from unittest import mock
|
||
|
|
except ImportError:
|
||
|
|
from mock import mock
|
||
|
|
|
||
|
|
import configurations
|
||
|
|
|
||
|
|
print('setup_1')
|
||
|
|
configurations.setup()
|
||
|
|
|
||
|
|
with mock.patch('django.setup', side_effect=Exception('setup called twice')):
|
||
|
|
print('setup_2')
|
||
|
|
configurations.setup()
|
||
|
|
|
||
|
|
print('setup_done')
|