mirror of https://github.com/interlegis/sigi.git
Marcio Mazza
10 years ago
1 changed files with 20 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
import pytest |
||||
|
from django_webtest import DjangoTestApp, WebTestMixin |
||||
|
|
||||
|
|
||||
|
@pytest.fixture(scope='function') |
||||
|
def app(request): |
||||
|
"""WebTest's TestApp. |
||||
|
|
||||
|
Patch and unpatch settings before and after each test. |
||||
|
|
||||
|
WebTestMixin, when used in a unittest.TestCase, automatically calls |
||||
|
_patch_settings() and _unpatchsettings. |
||||
|
|
||||
|
source: https://gist.github.com/magopian/6673250 |
||||
|
""" |
||||
|
wtm = WebTestMixin() |
||||
|
wtm._patch_settings() |
||||
|
request.addfinalizer(wtm._unpatch_settings) |
||||
|
return DjangoTestApp() |
Loading…
Reference in new issue