예제 #1
0
 def test_missing_warning_karma_form(self):
     data = {
         'note': '',
         'karma': '-50'
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertFalse(form.is_valid())
예제 #2
0
 def test_missing_warning_karma_form(self):
     data = {
         'warning': "",
         'points': "-50"
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertFalse(form.is_valid())
예제 #3
0
 def test_valid_karma_form(self):
     data = {
         'note': 'bad user is bad !',
         'karma': '-50'
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertTrue(form.is_valid())
예제 #4
0
 def test_valid_karma_form(self):
     data = {
         'warning': "bad user is bad !",
         'points': "-50"
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertTrue(form.is_valid())
예제 #5
0
 def test_missing_warning_karma_form(self):
     data = {
         'note': '',
         'karma': '-50'
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertFalse(form.is_valid())
예제 #6
0
 def test_valid_karma_form(self):
     data = {
         'note': 'bad user is bad !',
         'karma': '-50'
     }
     form = KarmaForm(data=data, profile=self.user)
     self.assertTrue(form.is_valid())
예제 #7
0
 def test_missing_points_karma_form(self):
     data = {
         'note': 'bad user is bad !',
         'karma': ''
     }
     form = KarmaForm(data=data, profile=self.user)
     # should be fine as points is not required=True
     self.assertTrue(form.is_valid())
예제 #8
0
 def test_missing_points_karma_form(self):
     data = {
         'warning': "bad user is bad !",
         'points': ""
     }
     form = KarmaForm(data=data, profile=self.user)
     # should be fine as points is not required=True
     self.assertTrue(form.is_valid())
예제 #9
0
 def test_missing_points_karma_form(self):
     data = {
         'note': 'bad user is bad !',
         'karma': ''
     }
     form = KarmaForm(data=data, profile=self.user)
     # should be fine as points is not required=True
     self.assertTrue(form.is_valid())
예제 #10
0
 def test_missing_warning_karma_form(self):
     data = {"note": "", "karma": "-50"}
     form = KarmaForm(data=data, profile=self.user)
     self.assertFalse(form.is_valid())
예제 #11
0
 def test_valid_karma_form(self):
     data = {"note": "bad user is bad !", "karma": "-50"}
     form = KarmaForm(data=data, profile=self.user)
     self.assertTrue(form.is_valid())