Пример #1
0
 def test_published_order(self):
     """Published items should by in 'order' order."""
     make_test_content(
         make_container(self.section, 9),
         ModerateState.published(),
         'ABC'
     )
     make_test_content(
         make_container(self.section, 8),
         ModerateState.published(),
         'XYZ'
     )
     published = TestContent.objects.published(self.section)
     self.assertListEqual(
         ['XYZ', 'ABC'],
         [t.title for t in published]
     )
Пример #2
0
 def test_pending_order(self):
     """Pending items should be in 'order' order."""
     make_test_content(
         make_container(self.section, 5),
         ModerateState.pending(),
         'ABC'
     )
     make_test_content(
         make_container(self.section, 3),
         ModerateState.published(),
         'LMN'
     )
     make_test_content(
         make_container(self.section, 1),
         ModerateState.pending(),
         'XYZ'
     )
     pending = TestContent.objects.pending(self.section)
     self.assertListEqual(
         [
             'XYZ',
             'LMN',
             'ABC',
         ],
         [t.title for t in pending]
     )