Пример #1
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)

        for user in User.objects.all():
            ModeratedObject(content_object=user).save()
Пример #2
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)

        for user in User.objects.all():
            ModeratedObject(content_object=user).save()
Пример #3
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 = ModerationAdmin(UserProfile, site)

        self.profile = UserProfile.objects.get(user__username='******')
        self.moderated_obj = ModeratedObject(content_object=self.profile)
        self.moderated_obj.save()
Пример #4
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)
     
     for user in User.objects.all():
         ModeratedObject(content_object=user).save()
         
     self.moderated_objects = ModeratedObject.objects.all()
Пример #5
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()
Пример #6
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()
Пример #7
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.new_moderation, self.old_moderation = setup_moderation(models)
        
        self.m1 = ModelWithSlugField(slug='test')
        self.m1.save()
        
        self.m2 = ModelWithSlugField2(slug='test')
        self.m2.save()
Пример #8
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()
Пример #9
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()