コード例 #1
0
 def test_get_index_queryset(self):
     idx_obj = PeopleIndex()
     # Person2 does NOT have an EN translation, so should appear here.
     self.assertEqualItems(
         [q.id for q in idx_obj.get_index_queryset("en")],
         [self.person1.id],
     )
     # Both person objects have DE translations
     self.assertEqualItems(
         [q.id for q in idx_obj.get_index_queryset("de")],
         [self.person1.id, self.person2.id],
     )
コード例 #2
0
 def test_get_index_queryset(self):
     idx_obj = PeopleIndex()
     # Person2 does NOT have an EN translation, so should appear here.
     self.assertEqualItems(
         [q.id for q in idx_obj.get_index_queryset("en")],
         [self.person1.id],
     )
     # Both person objects have DE translations
     self.assertEqualItems(
         [q.id for q in idx_obj.get_index_queryset("de")],
         [self.person1.id, self.person2.id],
     )