Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.web
Commits
6ef27ec3
Commit
6ef27ec3
authored
Sep 28, 2017
by
Philip ABBET
Browse files
[tests] Fix the hopeless rendering of the 500.html page during failed tests
parent
a6ad49e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
beat/web/settings/settings.py
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
##############################################################################
...
...
beat/web/ui/views.py
100644 → 100755
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
()
beat/web/urls.py
100644 → 100755
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'
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment