Beispiel #1
0
 def setUp(self):
     try:
         test_user = User.objects.get(username = '******')
     except ObjectDoesNotExist:
         test_user = test_user = User.objects.create_user(username = '******',
                                                          email = '*****@*****.**',
                                                          password = None)
     self.test_user = test_user
     
     try:
         test_user_2 = User.objects.get(username = '******')
     except ObjectDoesNotExist:
         test_user_2 = test_user = User.objects.create_user(username = '******',
                                                            email = '*****@*****.**',
                                                            password = None)
     self.user = test_user_2
     
     try:
         moderated_content = ModeratedContent.objects.get(content_type = ContentType.objects.get_for_model(User))
     except ObjectDoesNotExist:
         moderated_content = ModeratedContent(content_type = ContentType.objects.get_for_model(User),
                                              accept_threshold = 100,
                                              reject_threshold = 100)
         moderated_content.save()
     self.moderated_content = moderated_content
Beispiel #2
0
 def setUp(self):
     try:
         moderated_content = ModeratedContent.objects.get(content_type = ContentType.objects.get_for_model(User))
     except ObjectDoesNotExist:
         moderated_content = ModeratedContent(content_type = ContentType.objects.get_for_model(User),
                                              accept_threshold = 100,
                                              reject_threshold = 100)
         moderated_content.save()
         
     try:
         test_user = User.objects.get(username = '******')
     except ObjectDoesNotExist:
         test_user = test_user = User.objects.create_user(username = '******',
                                                          email = '*****@*****.**',
                                                          password = None)
     self.test_user = test_user
     self.user = test_user
     self.moderated_content = moderated_content
     self.moderated_contents = ModeratedContent.objects.all()
     
     try:
         accept_flag = ContentFlag.objects.get(name = ContentFlag.ACCEPT_FLAG)
     except ObjectDoesNotExist:
         accept_flag = ContentFlag(name = ContentFlag.ACCEPT_FLAG,
                                   active = True,
                                   description = '')
         accept_flag.save()
     self.accept_flag = accept_flag
 
     try:
         hidden_flag = ContentFlag.objects.get(name = ContentFlag.HIDDEN_FLAG)
     except ObjectDoesNotExist:
         hidden_flag = ContentFlag(name = ContentFlag.HIDDEN_FLAG,
                                   active = True,
                                   description = '')
         hidden_flag.save() 
     self.hidden_flag = hidden_flag