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
c621abe8
Commit
c621abe8
authored
4 months ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
test context processor
parent
6329eb3a
Branches
main
No related tags found
No related merge requests found
Pipeline
#150885
passed
4 months ago
Stage: test
Stage: deploy
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
setup.cfg
+1
-1
1 addition, 1 deletion
setup.cfg
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
31 additions
and
4 deletions
setup.cfg
+
1
−
1
View file @
c621abe8
[metadata]
[metadata]
name
=
django-live-settings
name
=
django-live-settings
version
=
1.0
version
=
1.0
.1
description
=
A Django app to have some settings stored in db, and editable at runtime
description
=
A Django app to have some settings stored in db, and editable at runtime
long_description
=
file: README.rst
long_description
=
file: README.rst
author
=
Bryan Brancotte
author
=
Bryan Brancotte
...
...
This diff is collapsed.
Click to expand it.
tests/settings.py
+
0
−
3
View file @
c621abe8
...
@@ -47,9 +47,6 @@ TEMPLATES = [
...
@@ -47,9 +47,6 @@ TEMPLATES = [
'
django.template.context_processors.request
'
,
'
django.template.context_processors.request
'
,
'
django.contrib.auth.context_processors.auth
'
,
'
django.contrib.auth.context_processors.auth
'
,
'
django.contrib.messages.context_processors.messages
'
,
'
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
"
,
"
live_settings.context_processors.processors
"
,
],
],
},
},
...
...
This diff is collapsed.
Click to expand it.
tests/templates/tests/foo.html
0 → 100644
+
5
−
0
View file @
c621abe8
{%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 @
c621abe8
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 @
c621abe8
from
django.urls
import
path
,
include
from
django.urls
import
path
,
include
from
django.views.generic
import
TemplateView
urlpatterns
=
[
urlpatterns
=
[
path
(
'
live_settings/
'
,
include
(
"
live_settings.urls
"
)),
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