def setUp(self):
        class BypassModerator(GenericModerator):
            visibility_column = 'is_public'
            bypass_moderation_after_approval = True

        setup_moderation([(ModelWithVisibilityField, BypassModerator)])
        self.user = User.objects.get(username='******')
Example #2
0
    def setUp(self):
        self.client.force_login(User.objects.get(username='******'))

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

        setup_moderation([(UserProfile, UserProfileModerator)])
    def setUp(self):
        class BypassModerator(GenericModerator):
            visibility_column = 'is_public'
            bypass_moderation_after_approval = True

        setup_moderation([(ModelWithVisibilityField, BypassModerator)])
        self.user = User.objects.get(username='******')
Example #4
0
    def setUp(self):
        self.client.login(username='******', password='******')

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

        setup_moderation([(UserProfile, UserProfileModerator)])
Example #5
0
    def setUp(self):
        self.moderation = ModerationManager()

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

        setup_moderation([(ModelWithMultipleManagers,
                           ModelWithMultipleManagersModerator)])
    def setUp(self):
        if django_110():
            self.client.force_login(User.objects.get(username='******'))
        else:
            self.client.login(username='******', password='******')

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

        setup_moderation([(UserProfile, UserProfileModerator)])
Example #7
0
    def setUp(self):
        if django_110():
            self.client.force_login(User.objects.get(username='******'))
        else:
            self.client.login(username='******', password='******')

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

        setup_moderation([(UserProfile, UserProfileModerator)])
Example #8
0
    def setUp(self):
        class UserProfileModerator(GenericModerator):
            visibility_column = 'is_public'

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

        self.user = User.objects.get(username='******')
Example #9
0
    def setUp(self):

        class UserProfileModerator(GenericModerator):
            visibility_column = 'is_public'

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

        self.user = User.objects.get(username='******')
Example #10
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='******')
Example #11
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='******')
Example #12
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)])
Example #13
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, ModelWithImage])
Example #14
0
    def setUp(self):
        class BookModerator(GenericModerator):
            auto_approve_for_staff = False
        self.moderation = setup_moderation([(Book, BookModerator)])

        self.user = User.objects.get(username='******')
        self.user.user_permissions.add(
            Permission.objects.get(codename='change_book'))

        self.book = Book.objects.create(title="Book not modified",
                                        author="Nico")
    def setUp(self):
        class BookModerator(GenericModerator):
            auto_approve_for_staff = False
        self.moderation = setup_moderation([(Book, BookModerator)])

        self.user = User.objects.get(username='******')
        self.user.user_permissions.add(
            Permission.objects.get(codename='change_book'))

        self.book = Book.objects.create(title="Book not modified", 
                                        author="Nico")
Example #16
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='******')
Example #17
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)])
    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()
Example #19
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='******')
Example #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()
    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()
Example #22
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()
Example #23
0
        def setUp(self):
            from tests.utils 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()
        def setUp(self):
            from tests.utils 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()
Example #25
0
    def setUp(self):
        from tests.models import CustomUser,\
            UserProfileWithCustomUser
        from django.contrib.auth import get_user_model
        self.user = CustomUser.objects.create(
            username='******',
            password='******')
        self.copy_m = ModeratedObject.moderated_by
        ModeratedObject.moderated_by = models.ForeignKey(
            get_user_model(), blank=True, null=True, editable=False,
            related_name='moderated_by_set')

        self.profile = UserProfileWithCustomUser.objects.create(
            user=self.user,
            description='Old description',
            url='http://google.com')
        self.moderation = setup_moderation([UserProfileWithCustomUser])
Example #26
0
    def setUp(self):
        from tests.models import CustomUser,\
            UserProfileWithCustomUser
        from django.conf import settings
        self.user = CustomUser.objects.create(
            username='******',
            password='******')
        self.copy_m = ModeratedObject.by
        ModeratedObject.by = models.ForeignKey(
            getattr(settings, 'AUTH_USER_MODEL', 'auth.User'),
            blank=True, null=True, editable=False,
            related_name='moderated_objects')

        self.profile = UserProfileWithCustomUser.objects.create(
            user=self.user,
            description='Old description',
            url='http://google.com')
        self.moderation = setup_moderation([UserProfileWithCustomUser])
Example #27
0
    def setUp(self):
        from tests.models import CustomUser,\
            UserProfileWithCustomUser
        from django.contrib.auth import get_user_model
        self.user = CustomUser.objects.create(username='******',
                                              password='******')
        self.copy_m = ModeratedObject.moderated_by
        ModeratedObject.moderated_by = models.ForeignKey(
            get_user_model(),
            blank=True,
            null=True,
            editable=False,
            related_name='moderated_by_set')

        self.profile = UserProfileWithCustomUser.objects.create(
            user=self.user,
            description='Old description',
            url='http://google.com')
        self.moderation = setup_moderation([UserProfileWithCustomUser])
Example #28
0
 def setUp(self):
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
     self.moderation = setup_moderation([UserProfile])
Example #29
0
 def setUp(self):
     self.moderation = setup_moderation()
     self.user = User.objects.get(username='******')
Example #30
0
 def setUp(self):
     self.moderation = setup_moderation([ModelWithSlugField])
Example #31
0
 def setUp(self):
     setup_moderation([UserProfile])
Example #32
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile, ModelWithSlugField2])

        self.user = User.objects.get(username='******')
Example #33
0
 def setUp(self):
     setup_moderation([UserProfile])
 def setUp(self):
     setup_moderation([UserProfile, ModelWithModeratedFields])
     self.user = User.objects.get(username='******')
Example #35
0
 def setUp(self):
     self.moderation = setup_moderation()
Example #36
0
    def setUp(self):
        self.moderation = setup_moderation([UserProfile, ModelWithSlugField2])

        self.user = User.objects.get(username='******')
 def setUp(self):
     setup_moderation([ModelWithModeratedFields])
Example #38
0
 def setUp(self):
     self.user = User.objects.get(username='******')
     self.profile = UserProfile.objects.get(user__username='******')
     self.moderation = setup_moderation([UserProfile])
Example #39
0
    def setUp(self):
        setup_moderation([UserProfile])

        self.user = User.objects.get(username='******')
Example #40
0
    def setUp(self):
        setup_moderation([UserProfile])

        self.user = User.objects.get(username='******')
 def setUp(self):
     setup_moderation([ModelWithModeratedFields])