-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
conftest.py
53 lines (46 loc) · 1.68 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import pytest
from django.conf import settings
from dj_angles.mappers.mapper import clear_tag_map
def pytest_configure():
settings.configure(
TEMPLATES=[
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
"tests/templates",
],
"OPTIONS": {
"builtins": [
"django_bird.templatetags.django_bird",
],
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
"loaders": [
(
"django.template.loaders.cached.Loader",
[
"dj_angles.template_loader.Loader",
"django_bird.loader.BirdLoader",
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
],
)
],
},
},
],
SECRET_KEY="this-is-a-secret",
ANGLES={},
)
@pytest.fixture(autouse=True)
def reset_settings(settings):
# Make sure that ANGLES is empty before every test
settings.ANGLES = {}
# Clear the tag map before every test
clear_tag_map()
# Run test
yield