Merge lp:~jtv/launchpad/recife-another-testfix into lp:~launchpad/launchpad/recife

Proposed by Jeroen T. Vermeulen on 2010-07-06
Status: Merged
Merged at revision: 9142
Proposed branch: lp:~jtv/launchpad/recife-another-testfix
Merge into: lp:~launchpad/launchpad/recife
Diff against target: 16 lines (+1/-1)
1 file modified
lib/lp/translations/tests/test_setcurrenttranslation.py (+1/-1)
To merge this branch: bzr merge lp:~jtv/launchpad/recife-another-testfix
Reviewer Review Type Date Requested Status
Henning Eggers (community) code 2010-07-06 Approve on 2010-07-06
Review via email: mp+29262@code.launchpad.net

Commit Message

Another test fix for recife branch (db-stable changes break test).

Description of the Change

= Another Recife test fix =

Fixes a test failure in our recife feature branch that creeps in when merging the latest db-stable into it.

As far as I can see, there's been a change in the outcome of:

    >>> series = factory.makeProductSeries(distribution=ubuntu)
    >>> print series == ubuntu.currentseries

The test did the equivalent of:

    >>> new_series = factory.makeProductSeries(distribution=ubuntu)
    >>> template1 = factory.makePOTemplate(
    ... distroseries=ubuntu.currentseries, sourcepackagename=foo, name='x')
    >>> template2 = factory.makePOTemplate(
    ... distroseries=new_series, sourcepackagename=foo, name='x')

This passes just fine on the current recife branch, but after merging db-stable into the branch, violates a database unique constraint on POTemplate(distroseries, sourcepackagename, name).

The solution is easy and works either way: don't create new_series until we need it.

To test,
{{{
./bin/test -vv -m lp.translations.tests -t SetCurrentTranslation
}}}

No lint, apart from silly import warnings about /usr/share/pyshared/...

Jeroen

To post a comment you must log in.
Henning Eggers (henninge) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/tests/test_setcurrenttranslation.py'
2--- lib/lp/translations/tests/test_setcurrenttranslation.py 2010-07-02 13:00:56 +0000
3+++ lib/lp/translations/tests/test_setcurrenttranslation.py 2010-07-06 09:35:41 +0000
4@@ -1126,11 +1126,11 @@
5 def setUp(self):
6 super(TestSetCurrentTranslation_Ubuntu, self).setUp()
7 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
8- sharing_series = self.factory.makeDistroRelease(distribution=ubuntu)
9 sourcepackagename = self.factory.makeSourcePackageName()
10 potemplate = self.factory.makePOTemplate(
11 distroseries=ubuntu.currentseries,
12 sourcepackagename=sourcepackagename)
13+ sharing_series = self.factory.makeDistroRelease(distribution=ubuntu)
14 sharing_potemplate = self.factory.makePOTemplate(
15 distroseries=sharing_series,
16 sourcepackagename=sourcepackagename,

Subscribers

People subscribed via source and target branches