Changeset - 8805d3e688eb
[Not reviewed]
default
0 2 0
Mads Kiilerich - 9 years ago 2016-08-04 14:23:36
madski@unity3d.com
defaults: remove stub controllers

Remove empty controllers that seem to be left over from experiments with the
automatic 'routes' routing for 'resource'.

Also, remove test coverage of this. The tests didn't even test the empty
controllers and have been broken for a while.
2 files changed with 0 insertions and 60 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/defaults.py
Show inline comments
 
@@ -66,20 +66,12 @@ class DefaultsController(BaseController)
 
            render('admin/defaults/defaults.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    def create(self):
 
        """POST /defaults: Create a new item"""
 
        # url('defaults')
 

	
 
    def new(self, format='html'):
 
        """GET /defaults/new: Form to create a new item"""
 
        # url('new_default')
 

	
 
    def update(self, id):
 
        """PUT /defaults/id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('default', id=ID),
 
@@ -110,23 +102,6 @@ class DefaultsController(BaseController)
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('Error occurred during update of defaults'),
 
                    category='error')
 

	
 
        raise HTTPFound(location=url('defaults'))
 

	
 
    def delete(self, id):
 
        """DELETE /defaults/id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('default', id=ID),
 
        #           method='delete')
 
        # url('default', id=ID)
 

	
 
    def show(self, id, format='html'):
 
        """GET /defaults/id: Show a specific item"""
 
        # url('default', id=ID)
 

	
 
    def edit(self, id, format='html'):
 
        """GET /defaults/id/edit: Form to edit an existing item"""
 
        # url('edit_default', id=ID)
kallithea/tests/functional/test_admin_defaults.py
Show inline comments
 
@@ -9,25 +9,12 @@ class TestDefaultsController(TestControl
 
        response = self.app.get(url('defaults'))
 
        response.mustcontain('default_repo_private')
 
        response.mustcontain('default_repo_enable_statistics')
 
        response.mustcontain('default_repo_enable_downloads')
 
        response.mustcontain('default_repo_enable_locking')
 

	
 
    def test_index_as_xml(self):
 
        response = self.app.get(url('formatted_defaults', format='xml'))
 

	
 
    def test_create(self):
 
        response = self.app.post(url('defaults'),
 
            {'_authentication_token': self.authentication_token()})
 

	
 
    def test_new(self):
 
        response = self.app.get(url('new_default'))
 

	
 
    def test_new_as_xml(self):
 
        response = self.app.get(url('formatted_new_default', format='xml'))
 

	
 
    def test_update_params_true_hg(self):
 
        self.log_user()
 
        params = {
 
            'default_repo_enable_locking': True,
 
            'default_repo_enable_downloads': True,
 
            'default_repo_enable_statistics': True,
 
@@ -55,28 +42,6 @@ class TestDefaultsController(TestControl
 
        response = self.app.put(url('default', id='default'), params=params)
 
        self.checkSessionFlash(response, 'Default settings updated successfully')
 

	
 
        params.pop('_authentication_token')
 
        defs = Setting.get_default_repo_settings()
 
        assert params == defs
 

	
 
    def test_update_browser_fakeout(self):
 
        response = self.app.post(url('default', id=1), params=dict(_method='put', _authentication_token=self.authentication_token()))
 

	
 
    def test_delete(self):
 
        # Not possible due to CSRF protection.
 
        response = self.app.delete(url('default', id=1), status=405)
 

	
 
    def test_delete_browser_fakeout(self):
 
        response = self.app.post(url('default', id=1), params=dict(_method='delete', _authentication_token=self.authentication_token()))
 

	
 
    def test_show(self):
 
        response = self.app.get(url('default', id=1))
 

	
 
    def test_show_as_xml(self):
 
        response = self.app.get(url('formatted_default', id=1, format='xml'))
 

	
 
    def test_edit(self):
 
        response = self.app.get(url('edit_default', id=1))
 

	
 
    def test_edit_as_xml(self):
 
        response = self.app.get(url('formatted_edit_default', id=1, format='xml'))
0 comments (0 inline, 0 general)