Beispiel #1
0
 def test_delete_remarks_update_cache(self):
     note = NoteFactory(author=self.user1,
                        document=self.doc,
                        revision=self.revision.revision)
     self.assertEqual(get_discussion_length(self.revision), 1)
     note.delete()
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #2
0
 def test_delete_remarks_update_cache(self):
     note = NoteFactory(
         author=self.user1,
         document=self.doc,
         revision=self.revision.revision)
     self.assertEqual(get_discussion_length(self.revision), 1)
     note.delete()
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #3
0
 def test_new_remarks_update_cache(self):
     for _ in range(10):
         NoteFactory(
             author=self.user1,
             document=self.doc,
             revision=self.revision.revision,
         )
     self.assertEqual(get_discussion_length(self.revision), 10)
Beispiel #4
0
 def test_new_remarks_update_cache(self):
     for _ in range(10):
         NoteFactory(
             author=self.user1,
             document=self.doc,
             revision=self.revision.revision,
         )
     self.assertEqual(get_discussion_length(self.revision), 10)
Beispiel #5
0
 def test_cancel_review_updates_cache(self):
     for _ in range(10):
         NoteFactory(
             author=self.user1,
             document=self.doc,
             revision=self.revision.revision,
         )
     self.revision.cancel_review()
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #6
0
 def test_cancel_review_updates_cache(self):
     for _ in range(10):
         NoteFactory(
             author=self.user1,
             document=self.doc,
             revision=self.revision.revision,
         )
     self.revision.cancel_review()
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #7
0
 def test_empty_discussion(self):
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #8
0
def discussion_length_badge(revision):
    length = get_discussion_length(revision)
    return '<span class="badge">{}</span>'.format(length)
Beispiel #9
0
def discussion_length(revision):
    length = get_discussion_length(revision)
    return length
Beispiel #10
0
def discussion_length_badge(revision):
    length = get_discussion_length(revision)
    return format_html('<span class="badge">{}</span>', length)
Beispiel #11
0
 def test_empty_discussion(self):
     self.assertEqual(get_discussion_length(self.revision), 0)
Beispiel #12
0
def discussion_length_badge(revision):
    length = get_discussion_length(revision)
    return '<span class="badge">{}</span>'.format(length)