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

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

src/m/e/mediadrop-HEAD/mediadrop/model/tests/user_example_test.py   mediadrop(Download)
    def test_can_create_example_user(self):
        user = User.example()
 
        assert_not_none(user.id)
        assert_equals(u'joe', user.user_name)
    def test_can_override_example_data(self):
        user = User.example(display_name=u'Bar Foo')
 
        assert_equals(u'Bar Foo', user.display_name)
 

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'))
    def test_uses_correct_redirect_url_if_mediadrop_is_mounted_in_subdirectory(self):
        user = User.example()
 
        request = self.init_fake_request(server_name='server.example',
            request_uri='/login/post_login')
    def _create_user_with_admin_permission_only(self):
        admin_perm = DBSession.query(Permission).filter(Permission.permission_name == u'admin').one()
        second_admin_group = Group.example(name=u'Second admin group')
        admin_perm.groups.append(second_admin_group)
        admin = User.example(groups=[second_admin_group])
    def _create_user_with_edit_permission_only(self):
        editor = User.example(groups=[self.editor_group()])
        perm = MediaDropPermissionSystem.permissions_for_user(editor, config)
        assert_true(perm.contains_permission(u'edit'))
        assert_false(perm.contains_permission(u'admin'))