Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/m/e/mediadrop-HEAD/mediadrop/controllers/tests/login_test.py   mediadrop(Download)
    def test_non_editors_are_redirect_to_home_page_after_login(self):
        user = User.example()
        perm = MediaDropPermissionSystem.permissions_for_user(user, config)
        assert_false(perm.contains_permission(u'edit'))
        assert_false(perm.contains_permission(u'admin'))
        admin = User.example(groups=[second_admin_group])
        DBSession.commit()
        perm = MediaDropPermissionSystem.permissions_for_user(admin, config)
        assert_true(perm.contains_permission(u'admin'))
        assert_false(perm.contains_permission(u'edit'))
        return admin
 
    def _create_user_with_edit_permission_only(self):
        editor = User.example(groups=[self.editor_group()])
        perm = MediaDropPermissionSystem.permissions_for_user(editor, config)

src/m/e/mediadrop-HEAD/mediadrop/lib/auth/tests/mediadrop_permission_system_test.py   mediadrop(Download)
    def assert_user_groups(self, groups, user):
        perm = MediaDropPermissionSystem.permissions_for_user(user, self.pylons_config)
        assert_equals(set(groups), set(perm.groups))