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='******')
def setUp(self): self.client.force_login(User.objects.get(username='******')) class UserProfileModerator(GenericModerator): fields_exclude = ['url'] setup_moderation([(UserProfile, UserProfileModerator)])
def setUp(self): self.client.login(username='******', password='******') class UserProfileModerator(GenericModerator): fields_exclude = ['url'] setup_moderation([(UserProfile, UserProfileModerator)])
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)])
def setUp(self): class UserProfileModerator(GenericModerator): visibility_column = 'is_public' self.moderation = setup_moderation([(ModelWithVisibilityField, UserProfileModerator)]) self.user = User.objects.get(username='******')
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='******')
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='******')
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): 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])
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 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='******')
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()
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='******')
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()
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.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])
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])
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])
def setUp(self): self.user = User.objects.get(username='******') self.profile = UserProfile.objects.get(user__username='******') self.moderation = setup_moderation([UserProfile])
def setUp(self): self.moderation = setup_moderation() self.user = User.objects.get(username='******')
def setUp(self): self.moderation = setup_moderation([ModelWithSlugField])
def setUp(self): setup_moderation([UserProfile])
def setUp(self): self.moderation = setup_moderation([UserProfile, ModelWithSlugField2]) self.user = User.objects.get(username='******')
def setUp(self): setup_moderation([UserProfile, ModelWithModeratedFields]) self.user = User.objects.get(username='******')
def setUp(self): self.moderation = setup_moderation()
def setUp(self): setup_moderation([ModelWithModeratedFields])
def setUp(self): setup_moderation([UserProfile]) self.user = User.objects.get(username='******')