示例#1
0
    def setUp(self):
        self.client.login(username='******', password='******')

        class UserProfileModerator(GenericModerator):
            fields_exclude = ['url']

        setup_moderation([(UserProfile, UserProfileModerator)])
示例#2
0
    def setUp(self):
        self.client.login(username='******', password='******')

        class UserProfileModerator(GenericModerator):
            fields_exclude = ['url']

        setup_moderation([(UserProfile, UserProfileModerator)])
示例#3
0
    def setUp(self):
        self.moderation = ModerationManager()

        class ModelWithMultipleManagersModerator(GenericModerator):
            manager_names = ['objects', 'men', 'women']

        setup_moderation([(ModelWithMultipleManagers,
                           ModelWithMultipleManagersModerator)])
示例#4
0
    def setUp(self):
        self.moderation = ModerationManager()

        class ModelWithMultipleManagersModerator(GenericModerator):
            manager_names = ['objects', 'men', 'women']

        setup_moderation([(ModelWithMultipleManagers,
                           ModelWithMultipleManagersModerator)])
示例#5
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            visibility_column = "is_public"

        self.moderation = setup_moderation([(ModelWithVisibilityField, UserProfileModerator)])

        self.user = User.objects.get(username="******")
示例#6
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            bypass_moderation_after_approval = True

        self.moderation = setup_moderation([(UserProfile, UserProfileModerator)])

        self.user = User.objects.get(username="******")
        self.profile = UserProfile.objects.get(user__username="******")
示例#7
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            visibility_column = 'is_public'

        self.moderation = setup_moderation([(ModelWithVisibilityField,
                                             UserProfileModerator)])

        self.user = User.objects.get(username='******')
示例#8
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            bypass_moderation_after_approval = True

        self.moderation = setup_moderation([(UserProfile, UserProfileModerator)
                                            ])

        self.user = User.objects.get(username='******')
        self.profile = UserProfile.objects.get(user__username='******')
示例#9
0
 def setUp(self):
     class UserProfileModerator(GenericModerator):
         notify_moderator = False
     
     self.moderation = setup_moderation([(UserProfile, UserProfileModerator)])
     
     self.moderation._disconnect_signals(UserProfile)
     
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
示例#10
0
    def setUp(self):
        self.user = User.objects.get(username='******')

        class ModeratedObjectForm(BaseModeratedObjectForm):

            class Meta:
                model = UserProfile

        self.ModeratedObjectForm = ModeratedObjectForm
        self.moderation = setup_moderation([UserProfile])
示例#11
0
 def setUp(self):
     from django.db.models import signals
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
     
     class UserProfileModerator(GenericModerator):
         visibility_column = 'is_public'
     
     self.moderation = setup_moderation([UserProfile,
                         (ModelWithVisibilityField, UserProfileModerator)])
示例#12
0
    def setUp(self):
        self.user = User.objects.get(username='******')

        class ModeratedObjectForm(BaseModeratedObjectForm):
            extra = CharField(required=False)

            class Meta:
                model = UserProfile

        self.ModeratedObjectForm = ModeratedObjectForm
        self.moderation = setup_moderation([UserProfile])
示例#13
0
    def setUp(self):
        from django.db.models import signals

        self.user = User.objects.get(username='******')
        self.profile = UserProfile.objects.get(user__username='******')

        class UserProfileModerator(GenericModerator):
            visibility_column = 'is_public'

        self.moderation = setup_moderation(
            [UserProfile, (ModelWithVisibilityField, UserProfileModerator)])
示例#14
0
    def setUp(self):
        self.user = User.objects.get(username='******')

        class ModeratedObjectForm(BaseModeratedObjectForm):
            extra = CharField(required=False)

            class Meta:
                model = UserProfile

        self.ModeratedObjectForm = ModeratedObjectForm
        self.moderation = setup_moderation([UserProfile])
示例#15
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            notify_moderator = False

        self.moderation = setup_moderation([(UserProfile, UserProfileModerator)
                                            ])

        self.moderation._disconnect_signals(UserProfile)

        self.user = User.objects.get(username='******')
        self.profile = UserProfile.objects.get(user__username='******')
示例#16
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile])

        rf = RequestFactory()
        rf.login(username="******", password="******")
        self.request = rf.get("/admin/moderation/")
        self.request.user = User.objects.get(username="******")
        self.admin = ModerationAdmin(UserProfile, site)

        self.profile = UserProfile.objects.get(user__username="******")
        self.moderated_obj = ModeratedObject(content_object=self.profile)
        self.moderated_obj.save()
示例#17
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile])

        rf = RequestFactory()
        rf.login(username='******', password='******')
        self.request = rf.get('/admin/moderation/')
        self.request.user = User.objects.get(username='******')
        self.request._messages = mock.Mock()
        self.admin = ModerationAdmin(UserProfile, site)

        self.profile = UserProfile.objects.get(user__username='******')
        self.moderated_obj = ModeratedObject(content_object=self.profile)
        self.moderated_obj.save()
示例#18
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile])

        rf = RequestFactory()
        rf.login(username='******', password='******')
        self.request = rf.get('/admin/moderation/')
        self.request.user = User.objects.get(username='******')
        self.request._messages = mock.Mock()
        self.admin = ModerationAdmin(UserProfile, site)

        self.profile = UserProfile.objects.get(user__username='******')
        self.moderated_obj = ModeratedObject(content_object=self.profile)
        self.moderated_obj.save()
示例#19
0
    def setUp(self):
        rf = RequestFactory()
        rf.login(username='******', password='******')
        self.request = rf.get('/admin/moderation/')
        self.request.user = User.objects.get(username='******')
        self.admin = ModeratedObjectAdmin(ModeratedObject, site)

        self.moderation = setup_moderation([User])

        for user in User.objects.all():
            ModeratedObject(content_object=user).save()

        self.moderated_objects = ModeratedObject.objects.all()
示例#20
0
    def setUp(self):
        rf = RequestFactory()
        rf.login(username="******", password="******")
        self.request = rf.get("/admin/moderation/")
        self.request.user = User.objects.get(username="******")
        self.admin = ModeratedObjectAdmin(ModeratedObject, site)

        self.moderation = setup_moderation([User])

        for user in User.objects.all():
            ModeratedObject(content_object=user).save()

        self.moderated_objects = ModeratedObject.objects.all()
示例#21
0
    def setUp(self):
        from moderation.tests import setup_moderation
        rf = RequestFactory()
        rf.login(username='******', password='******')
        self.request = rf.get('/admin/moderation/')
        self.request.user = User.objects.get(username='******')
        self.admin = ModerationAdmin(UserProfile, site)

        models = [ModelWithSlugField, ModelWithSlugField2]
        self.moderation = setup_moderation(models)
        
        self.m1 = ModelWithSlugField(slug='test')
        self.m1.save()
        
        self.m2 = ModelWithSlugField2(slug='test')
        self.m2.save()
示例#22
0
        def setUp(self):
            from moderation.tests import setup_moderation

            rf = RequestFactory()
            rf.login(username='******', password='******')
            self.request = rf.get('/admin/moderation/')
            self.request.user = User.objects.get(username='******')
            self.admin = ModerationAdmin(UserProfile, site)

            models = [ModelWithSlugField2, ModelWithSlugField]
            self.moderation = setup_moderation(models)

            self.m1 = ModelWithSlugField(slug='test')
            self.m1.save()

            self.m2 = ModelWithSlugField2(slug='test')
            self.m2.save()
示例#23
0
 def setUp(self):
     self.moderation = setup_moderation([ModelWithSlugField])
示例#24
0
 def setUp(self):
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
     self.moderation = setup_moderation([UserProfile])
示例#25
0
 def setUp(self):
     self.moderation = setup_moderation()
     self.user = User.objects.get(username='******')
示例#26
0
 def setUp(self):
     self.moderation = setup_moderation()
     self.user = User.objects.get(username='******')
示例#27
0
 def setUp(self):
     self.moderation = setup_moderation([ModelWithSlugField])
示例#28
0
 def setUp(self):
     setup_moderation([ModelWithModeratedFields])
示例#29
0
    def setUp(self):
        setup_moderation([UserProfile])

        self.user = User.objects.get(username='******')
示例#30
0
 def setUp(self):
     setup_moderation()
示例#31
0
 def setUp(self):
     setup_moderation([ModelWithModeratedFields])
示例#32
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile, ModelWithSlugField2])

        self.user = User.objects.get(username='******')
示例#33
0
 def setUp(self):
     setup_moderation([UserProfile])
示例#34
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile, ModelWithSlugField2])

        self.user = User.objects.get(username='******')
示例#35
0
 def setUp(self):
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
     self.moderation = setup_moderation([UserProfile])
示例#36
0
 def setUp(self):
     self.moderation = setup_moderation()