Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-live-settings
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
django-live-settings
Commits
d9219b55
Commit
d9219b55
authored
3 months ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
test context processor
parent
6329eb3a
No related branches found
No related tags found
No related merge requests found
Pipeline
#150884
failed
3 months ago
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tests/settings.py
+0
-3
0 additions, 3 deletions
tests/settings.py
tests/templates/tests/foo.html
+5
-0
5 additions, 0 deletions
tests/templates/tests/foo.html
tests/tests.py
+23
-0
23 additions, 0 deletions
tests/tests.py
tests/urls.py
+2
-0
2 additions, 0 deletions
tests/urls.py
with
30 additions
and
3 deletions
tests/settings.py
+
0
−
3
View file @
d9219b55
...
...
@@ -47,9 +47,6 @@ TEMPLATES = [
'
django.template.context_processors.request
'
,
'
django.contrib.auth.context_processors.auth
'
,
'
django.contrib.messages.context_processors.messages
'
,
'
basetheme_bootstrap.context_processors.processors
'
,
'
strass_app.context_processors.enrich_with_status
'
,
'
strass_app.context_processors.add_google_analytics_tracker
'
,
"
live_settings.context_processors.processors
"
,
],
},
...
...
This diff is collapsed.
Click to expand it.
tests/templates/tests/foo.html
0 → 100644
+
5
−
0
View file @
d9219b55
{%if live_settings.blabla__int == 0 %}
IS_0
{%else%}
IS_NONE
{%endif%}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/tests.py
0 → 100644
+
23
−
0
View file @
d9219b55
import
logging
from
django.test
import
TestCase
as
DjangoTestCase
from
django.urls
import
reverse
from
live_settings
import
live_settings
logger
=
logging
.
getLogger
(
__name__
)
class
LiveSettingsTestCase
(
DjangoTestCase
):
def
test_view_works
(
self
):
url
=
reverse
(
'
foo
'
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
"
IS_NONE
"
,
str
(
response
.
content
))
self
.
assertNotIn
(
"
IS_0
"
,
str
(
response
.
content
))
live_settings
.
blabla
=
0
response
=
self
.
client
.
get
(
url
)
self
.
assertIn
(
"
IS_0
"
,
str
(
response
.
content
))
self
.
assertNotIn
(
"
IS_NONE
"
,
str
(
response
.
content
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/urls.py
+
2
−
0
View file @
d9219b55
from
django.urls
import
path
,
include
from
django.views.generic
import
TemplateView
urlpatterns
=
[
path
(
'
live_settings/
'
,
include
(
"
live_settings.urls
"
)),
path
(
'
foo/
'
,
TemplateView
.
as_view
(
template_name
=
'
tests/foo.html
'
),
name
=
'
foo
'
),
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment