Files @ 6af3e67cc576
Branch filter:

Location: kallithea/rhodecode/tests/functional/test_admin_permissions.py

Bradley M. Kuhn
Add Twitter's Bootstrap 3.0.0 CSS and Javascript files, under Apache License 2.0

These files are exactly as they appear the upstream release 3.0.0 of
Bootstrap, which Twitter released under the Apache License 2.0. To extract
these files, I did the following:

I downloaded the following file:
https://github.com/twbs/bootstrap/archive/v3.0.0.zip

with sha256sum of:
$ sha256sum v3.0.0.zip
2d54f345f4abc6bf65ea648c323e9bae577e6febf755650e62555f2d7a222e17 v3.0.0.zip

And extracted from it these two files:
bootstrap-3.0.0/dist/css/bootstrap.css
bootstrap-3.0.0/dist/js/bootstrap.js
which are licensed under the Apache License 2.0.

and placed them into:
rhodecode/public/css/bootstrap.css
rhodecode/public/js/bootstrap.js
respectively.
from rhodecode.model.db import User, UserIpMap
from rhodecode.tests import *

class TestAdminPermissionsController(TestController):

    def test_index(self):
        self.log_user()
        response = self.app.get(url('admin_permissions'))
        # Test response...

    def test_index_ips(self):
        self.log_user()
        response = self.app.get(url('admin_permissions_ips'))
        # Test response...
        response.mustcontain('All IP addresses are allowed')

    def test_add_ips(self):
        self.log_user()
        default_user_id = User.get_default_user().user_id
        response = self.app.put(url('edit_user_ips', id=default_user_id),
                                 params=dict(new_ip='127.0.0.0/24'))

        response = self.app.get(url('admin_permissions_ips'))
        response.mustcontain('127.0.0.0/24')
        response.mustcontain('127.0.0.0 - 127.0.0.255')

        ## delete
        default_user_id = User.get_default_user().user_id
        del_ip_id = UserIpMap.query().filter(UserIpMap.user_id ==
                                             default_user_id).first().ip_id

        response = self.app.post(url('edit_user_ips', id=default_user_id),
                                 params=dict(_method='delete',
                                             del_ip_id=del_ip_id))

        response = self.app.get(url('admin_permissions_ips'))
        response.mustcontain('All IP addresses are allowed')
        response.mustcontain(no=['127.0.0.0/24'])
        response.mustcontain(no=['127.0.0.0 - 127.0.0.255'])


    def test_index_overview(self):
        self.log_user()
        response = self.app.get(url('admin_permissions_perms'))
        # Test response...