Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()