def test_can_create_example_group(self): group = Group.example() assert_not_none(group.group_id) assert_equals(u"baz_users", group.group_name) assert_equals(u"Baz Users", group.display_name) assert_almost_equals(datetime.now(), group.created, max_delta=timedelta(seconds=1))
def test_can_create_example_group(self): group = Group.example() assert_not_none(group.group_id) assert_equals(u'baz_users', group.group_name) assert_equals(u'Baz Users', group.display_name) assert_almost_equals(datetime.now(), group.created, max_delta=timedelta(seconds=1))
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]) DBSession.commit() perm = MediaCorePermissionSystem.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_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]) DBSession.commit() perm = MediaCorePermissionSystem.permissions_for_user(admin, config) assert_true(perm.contains_permission(u'admin')) assert_false(perm.contains_permission(u'edit')) return admin
def test_can_override_example_data(self): group = Group.example(name=u"bar", display_name=u"Bar Foo") assert_equals(u"Bar Foo", group.display_name) assert_equals(u"bar", group.group_name)
def test_can_override_example_data(self): group = Group.example(name=u'bar', display_name=u'Bar Foo') assert_equals(u'Bar Foo', group.display_name) assert_equals(u'bar', group.group_name)