示例#1
0
    def setUp(self):
        # Create objects for which we would assing obj perms
        self.target_user1 = User.objects.create(username="******")
        self.target_group1 = Group.objects.create(name="group1")
        self.target_obj1 = ContentType.objects.create(model="foo", app_label="fake-for-guardian-tests")
        self.target_obj2 = ContentType.objects.create(model="bar", app_label="fake-for-guardian-tests")
        # Required if MySQL backend is used :/
        create_permissions(auth_app, [], 1)

        self.user = User.objects.create(username="******")
        self.group = Group.objects.create(name="group")
示例#2
0
    def setUp(self):
        # Create objects for which we would assing obj perms
        self.target_user1 = User.objects.create(username='******')
        self.target_group1 = Group.objects.create(name='group1')
        self.target_obj1 = ContentType.objects.create(
            name='ct1', model='foo', app_label='fake-for-guardian-tests')
        self.target_obj2 = ContentType.objects.create(
            name='ct2', model='bar', app_label='fake-for-guardian-tests')
        # Required if MySQL backend is used :/
        create_permissions(auth_app, [], 1)

        self.user = User.objects.create(username='******')
        self.group = Group.objects.create(name='group')
示例#3
0
    def setUp(self):
        # Create objects for which we would assing obj perms
        self.target_user1 = User.objects.create(username='******')
        self.target_group1 = Group.objects.create(name='group1')
        self.target_obj1 = ContentType.objects.create(name='ct1', model='foo',
            app_label='fake-for-guardian-tests')
        self.target_obj2 = ContentType.objects.create(name='ct2', model='bar',
            app_label='fake-for-guardian-tests')
        # Required if MySQL backend is used :/
        create_permissions(auth_app, [], 1)


        self.user = User.objects.create(username='******')
        self.group = Group.objects.create(name='group')
示例#4
0
 def setUp(self):
     super(ObjectPermissionCheckerTest, self).setUp()
     # Required if MySQL backend is used :/
     create_permissions(auth_app, [], 1)
示例#5
0
 def setUp(self):
     super(ObjectPermissionCheckerTest, self).setUp()
     # Required if MySQL backend is used :/
     create_permissions(auth_app, [], 1)