diff --git a/swh/web/ui/templates/upload_and_search.html b/swh/web/ui/templates/search.html rename from swh/web/ui/templates/upload_and_search.html rename to swh/web/ui/templates/search.html diff --git a/swh/web/ui/tests/views/test_browse.py b/swh/web/ui/tests/views/test_browse.py --- a/swh/web/ui/tests/views/test_browse.py +++ b/swh/web/ui/tests/views/test_browse.py @@ -28,7 +28,7 @@ self.assertEqual(rv.status_code, 200) self.assertEqual(self.get_context_variable('message'), '') self.assertEqual(self.get_context_variable('search_res'), None) - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') @patch('swh.web.ui.views.browse.api') @istest @@ -50,7 +50,7 @@ {'filename': None, 'sha1': 'sha1:456', 'found': False}]) - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') mock_api.api_search.assert_called_once_with('sha1:456') @@ -66,7 +66,7 @@ self.assertEqual(rv.status_code, 200) self.assertEqual(self.get_context_variable('message'), 'error msg') self.assertEqual(self.get_context_variable('search_res'), None) - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') mock_api.api_search.assert_called_once_with('sha1_git:789') @@ -91,7 +91,7 @@ self.assertTrue(resp is not None) self.assertEqual(resp['sha1'], 'sha1:123') self.assertEqual(resp['found'], True) - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') mock_api.api_search.assert_called_once_with('sha1:123') @@ -116,7 +116,7 @@ self.assertEqual(self.get_context_variable('search_res'), None) self.assertEqual(self.get_context_variable('message'), 'error bad input') - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') @patch('swh.web.ui.views.browse.request') @patch('swh.web.ui.views.browse.api') @@ -153,7 +153,7 @@ self.assertEqual(b['found'], False) self.assertEqual(self.get_context_variable('message'), '') - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') @patch('swh.web.ui.views.browse.request') @patch('swh.web.ui.views.browse.api') @@ -189,7 +189,7 @@ a, b = self.get_context_variable('search_res') self.assertEqual(a['found'], False) self.assertEqual(b['found'], True) - self.assert_template_used('upload_and_search.html') + self.assert_template_used('search.html') class ContentView(test_app.SWHViewTestCase): diff --git a/swh/web/ui/views/browse.py b/swh/web/ui/views/browse.py --- a/swh/web/ui/views/browse.py +++ b/swh/web/ui/views/browse.py @@ -71,7 +71,7 @@ env['search_stats'] = search_stats env['search_res'] = search_res env['message'] = message - return render_template('upload_and_search.html', **env) + return render_template('search.html', **env) @app.route('/browse/content/')