~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Henning Eggers
  • Date: 2011-07-26 11:28:41 UTC
  • mto: This revision was merged to the branch mainline in revision 13526.
  • Revision ID: henning@canonical.com-20110726112841-8ohs4w6kchy99u6j
Removed lots of lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    def setUp(self):
38
38
        TestCaseWithFactory.setUp(self)
39
39
        self.potemplate = removeSecurityProxy(self.factory.makePOTemplate(
40
 
            translation_domain = "testdomain"))
 
40
            translation_domain="testdomain"))
41
41
 
42
42
    def assertIsDummy(self, pofile):
43
43
        """Assert that `pofile` is actually a `DummyPOFile`."""
92
92
        # Test that getDummyPOFile fails when trying to get a DummyPOFile
93
93
        # where a POFile already exists for that language.
94
94
        language = self.factory.makeLanguage('sr@test')
95
 
        pofile = self.potemplate.newPOFile(language.code)
 
95
        self.potemplate.newPOFile(language.code)
96
96
        self.assertRaises(
97
97
            AssertionError, self.potemplate.getDummyPOFile, language)
98
98
 
101
101
        # where a POFile already exists for that language when
102
102
        # check_for_existing=False is passed in.
103
103
        language = self.factory.makeLanguage('sr@test')
104
 
        pofile = self.potemplate.newPOFile(language.code)
 
104
        self.potemplate.newPOFile(language.code)
105
105
        # This is just "assertNotRaises".
106
106
        dummy = self.potemplate.getDummyPOFile(language,
107
107
                                               check_for_existing=False)
170
170
            removeFromSuggestivePOTemplatesCache after each toggle.
171
171
        """
172
172
        patched_method = FakeMethod(result=True)
173
 
        self.potemplate._removeFromSuggestivePOTemplatesCache = patched_method 
 
173
        self.potemplate._removeFromSuggestivePOTemplatesCache = patched_method
174
174
        call_counts = []
175
175
        for state in states:
176
176
            self.potemplate.setActive(state)
187
187
            [0, 1, 1, 1, 2],
188
188
            self._toggleIsCurrent([True, False, False, True, False]))
189
189
 
 
190
 
190
191
class EquivalenceClassTestMixin:
191
192
    """Helper for POTemplate equivalence class tests."""
192
193
 
267
268
            productseries=self.trunk, name='foo')
268
269
        stable_template = self.factory.makePOTemplate(
269
270
            productseries=self.stable, name='foo')
270
 
        other_stable_template = self.factory.makePOTemplate(
 
271
        self.factory.makePOTemplate(
271
272
            productseries=self.stable, name='foo-other')
272
273
 
273
274
        templates = set(list(self.subset.getSharingPOTemplates('foo')))
375
376
        hoary_template = self.factory.makePOTemplate(
376
377
            distroseries=self.warty, sourcepackagename=self.package,
377
378
            name=template_name)
378
 
        other_hoary_template = self.factory.makePOTemplate(
 
379
        self.factory.makePOTemplate(
379
380
            distroseries=self.warty, sourcepackagename=self.package,
380
381
            name=not_matching_name)
381
382
        subset = getUtility(IPOTemplateSet).getSharingSubset(
543
544
        # Manually creating a productseries to get one that is not the
544
545
        # translation focus.
545
546
        other_productseries = self.factory.makeProductSeries()
546
 
        other_template = self.factory.makePOTemplate(
 
547
        self.factory.makePOTemplate(
547
548
            productseries=other_productseries)
548
549
        product = other_productseries.product
549
550
        productseries = self.factory.makeProductSeries(