コード例 #1
0
 def test_gather_work_items_does_not_cache_across_templates(self):
     pofiles = [self.factory.makePOFile() for counter in range(2)]
     for pofile in pofiles:
         self.make_message_without_pofiletranslator(pofile)
     work_items = gather_work_items([pofile.id for pofile in pofiles])
     # The POFiles are for different templates, so they do not share
     # the same potmsgset_ids.
     self.assertNotEqual(work_items[0].potmsgset_ids,
                         work_items[1].potmsgset_ids)
コード例 #2
0
 def test_gather_work_items_does_not_cache_across_templates(self):
     pofiles = [self.factory.makePOFile() for counter in range(2)]
     for pofile in pofiles:
         self.make_message_without_pofiletranslator(pofile)
     work_items = gather_work_items([pofile.id for pofile in pofiles])
     # The POFiles are for different templates, so they do not share
     # the same potmsgset_ids.
     self.assertNotEqual(
         work_items[0].potmsgset_ids, work_items[1].potmsgset_ids)
コード例 #3
0
 def test_gather_work_items_caches_potmsgset_ids_for_same_template(self):
     template = self.factory.makePOTemplate()
     pofiles = [
         self.factory.makePOFile(potemplate=template)
         for counter in range(2)
     ]
     for pofile in pofiles:
         self.make_message_without_pofiletranslator(pofile)
     work_items = gather_work_items([pofile.id for pofile in pofiles])
     # The potmsgset_ids entries are references to one and the same
     # object.
     self.assertIs(work_items[0].potmsgset_ids, work_items[1].potmsgset_ids)
コード例 #4
0
 def test_gather_work_items_caches_potmsgset_ids_for_same_template(self):
     template = self.factory.makePOTemplate()
     pofiles = [
         self.factory.makePOFile(potemplate=template)
         for counter in range(2)]
     for pofile in pofiles:
         self.make_message_without_pofiletranslator(pofile)
     work_items = gather_work_items([pofile.id for pofile in pofiles])
     # The potmsgset_ids entries are references to one and the same
     # object.
     self.assertIs(
         work_items[0].potmsgset_ids, work_items[1].potmsgset_ids)