Пример #1
0
 def test_thank_anothers_note_karma(self):
     """Get karma for having your note thanked"""
     thank_note(self.request2, self.note.pk)
     try:
         NoteKarmaEvent.objects.get(note=self.note)
     except ObjectDoesNotExist:
         self.fail("Karma event not created")
Пример #2
0
 def test_thank_own_note_karma(self):
     """Make sure you don't get karma for thanking your own note"""
     thank_note(self.request1, self.note.pk)
     try:
         NoteKarmaEvent.objects.get(note=self.note)
         self.fail("You can't thank your own note")
     except ObjectDoesNotExist:
         pass
Пример #3
0
 def test_note_deleted_karma(self):
     """Lose karma if your note is deleted"""
     thank_note(self.request2, self.note.pk)
     self.note.delete()
     try:
         GenericKarmaEvent.objects.get(event_type=GenericKarmaEvent.NOTE_DELETED)
     except ObjectDoesNotExist:
         self.fail("Karma event not created")
     try:
         NoteKarmaEvent.objects.get(note=self.note)
         self.fail("Karma event not deleted")
     except ObjectDoesNotExist:
         pass