File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ def test_handle_no_page_for_root_url(self):
74
74
self .assertEqual (response .status_code , 302 )
75
75
self .assertEqual (response .url , reverse ('admin:cms_pagecontent_changelist' ))
76
76
77
+ def test_handle_no_page_for_rool_url_no_homepage (self ):
78
+ """
79
+ Test details view when visiting root and homepage doesn't exist
80
+ """
81
+ create_page ("one" , "nav_playground.html" , "en" )
82
+ response = self .client .get ("/en/" )
83
+ self .assertEqual (response .status_code , 302 )
84
+
77
85
def test_apphook_not_hooked (self ):
78
86
"""
79
87
Test details view when apphook pool has apphooks, but they're not
Original file line number Diff line number Diff line change @@ -115,8 +115,10 @@ def details(request, slug):
115
115
return HttpResponseRedirect (redirect_url )
116
116
117
117
if not page :
118
- # raise 404
119
- _handle_no_page (request )
118
+ # raise 404 or redirect to PageContent's
119
+ # changelist in the admin if this is a
120
+ # request to the root URL
121
+ return _handle_no_page (request )
120
122
121
123
request .current_page = page
122
124
You can’t perform that action at this time.
0 commit comments