Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
beat
beat.web
Commits
6ef27ec3
Commit
6ef27ec3
authored
7 years ago
by
Philip ABBET
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Fix the hopeless rendering of the 500.html page during failed tests
parent
a6ad49e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
beat/web/settings/settings.py
+4
-2
4 additions, 2 deletions
beat/web/settings/settings.py
beat/web/ui/views.py
+34
-0
34 additions, 0 deletions
beat/web/ui/views.py
beat/web/urls.py
+5
-0
5 additions, 0 deletions
beat/web/urls.py
with
43 additions
and
2 deletions
beat/web/settings/settings.py
+
4
−
2
View file @
6ef27ec3
...
...
@@ -205,8 +205,10 @@ CACHE_ROOT = os.path.join(PREFIX, 'cache')
#
##############################################################################
DATASETS_UID
=
None
DATASETS_ROOT_PATH
=
None
DATASETS_UID
=
1000
# DATASETS_UID = None
DATASETS_ROOT_PATH
=
'
/Users/pabbet/Projects/databases/
'
# DATASETS_ROOT_PATH = None
##############################################################################
...
...
This diff is collapsed.
Click to expand it.
beat/web/ui/views.py
100644 → 100755
+
34
−
0
View file @
6ef27ec3
...
...
@@ -57,6 +57,9 @@ import logging
logger
=
logging
.
getLogger
(
__name__
)
#----------------------------------------------------------
def
index
(
request
):
'''
Our main index page
'''
...
...
@@ -64,6 +67,9 @@ def index(request):
context_instance
=
RequestContext
(
request
))
#----------------------------------------------------------
def
login
(
request
):
'''
Login page
'''
...
...
@@ -78,6 +84,9 @@ def login(request):
return
response
#----------------------------------------------------------
def
blocked_user_reactivation
(
request
):
'''
Reactivation page
'''
...
...
@@ -185,6 +194,9 @@ def blocked_user_reactivation(request):
context_instance
=
RequestContext
(
request
))
#----------------------------------------------------------
def
gather_contributions
(
requestor
,
author
):
'''
Gather contributions that are accessible to a certain requestor
'''
...
...
@@ -233,6 +245,9 @@ def gather_contributions(requestor, author):
)
#----------------------------------------------------------
def
activity_stream
(
request
,
author_name
):
'''
User-specific activity stream
'''
...
...
@@ -259,6 +274,9 @@ def activity_stream(request, author_name):
)
#----------------------------------------------------------
@login_required
def
docreq
(
request
,
author_name
):
'''
Request a documentation for an existing platform object
'''
...
...
@@ -301,6 +319,9 @@ def docreq(request, author_name):
return
HttpResponse
()
#----------------------------------------------------------
@login_required
def
user_settings
(
request
):
'''
User settings page (password and token change)
'''
...
...
@@ -348,3 +369,16 @@ def user_settings(request):
},
},
context_instance
=
RequestContext
(
request
))
#----------------------------------------------------------
def
empty_error500_for_tests
(
request
):
'''
Custom error 500 view used ONLY DURING THE TESTS
Without it, Django tries to render the custom one from the website when an error
occurs in some tests, but fails because some variables needed by the template aren
'
t
found.
'''
return
HttpResponse
()
This diff is collapsed.
Click to expand it.
beat/web/urls.py
100644 → 100755
+
5
−
0
View file @
6ef27ec3
...
...
@@ -182,3 +182,8 @@ else:
# Static files (only working during development, when settings.DEBUG is True)
urlpatterns
+=
staticfiles_urlpatterns
()
# ONLY DURING THE TESTS: Custom error 500 view
if
getattr
(
settings
,
'
TEST_CONFIGURATION
'
,
False
):
handler500
=
'
beat.web.ui.views.empty_error500_for_tests
'
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