~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/tests/test_pofile.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-06 13:40:37 UTC
  • mfrom: (14097.2.8 bug-401618)
  • Revision ID: launchpad@pqm.canonical.com-20111006134037-76k7yw4rtcd91f9q
[r=abentley][bug=401618] Finally remove all use of POTMsgSet.sequence
        in our code, to fix an odd bug or two,
        and allow for column removal from the database.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1356
1356
        self.assertEquals(
1357
1357
            [self.potmsgset1, self.potmsgset2], potmsgsets)
1358
1358
 
1359
 
    def test_findPOTMsgSetsContaining_ordering(self):
1360
 
        # As per bug 388473 findPOTMsgSetsContaining still used the old
1361
 
        # potmsgset.sequence for ordering. Check that this is fixed.
1362
 
        # This test will go away when potmsgset.sequence goes away.
1363
 
 
1364
 
        # Give the method something to search for.
1365
 
        self.factory.makeCurrentTranslationMessage(
1366
 
            pofile=self.devel_pofile,
1367
 
            potmsgset=self.potmsgset1,
1368
 
            translations=["Shared translation"])
1369
 
        self.factory.makeCurrentTranslationMessage(
1370
 
            pofile=self.devel_pofile,
1371
 
            potmsgset=self.potmsgset2,
1372
 
            translations=["Another shared translation"])
1373
 
 
1374
 
        # Mess with potmsgset.sequence.
1375
 
        removeSecurityProxy(self.potmsgset1).sequence = 2
1376
 
        removeSecurityProxy(self.potmsgset2).sequence = 1
1377
 
 
1378
 
        potmsgsets = list(
1379
 
            self.devel_pofile.findPOTMsgSetsContaining("translation"))
1380
 
 
1381
 
        # Order ignores potmsgset.sequence.
1382
 
        self.assertEquals(
1383
 
            [self.potmsgset1, self.potmsgset2], potmsgsets)
1384
 
 
1385
1359
 
1386
1360
class TestPOFileSet(TestCaseWithFactory):
1387
1361
    """Test PO file set methods."""