Merge lp:~abentley/launchpad/pomessage-sequence into lp:launchpad
- pomessage-sequence
- Merge into devel
Status: | Merged |
---|---|
Merged at revision: | 12412 |
Proposed branch: | lp:~abentley/launchpad/pomessage-sequence |
Merge into: | lp:launchpad |
Diff against target: |
970 lines (+108/-128) 15 files modified
lib/lp/testing/factory.py (+5/-3) lib/lp/translations/tests/test_autoapproval.py (+2/-2) lib/lp/translations/tests/test_clearcurrenttranslation.py (+10/-10) lib/lp/translations/tests/test_helpers.py (+1/-2) lib/lp/translations/tests/test_pofile.py (+51/-52) lib/lp/translations/tests/test_potmsgset.py (+11/-15) lib/lp/translations/tests/test_setcurrenttranslation.py (+2/-2) lib/lp/translations/tests/test_shared_potemplate.py (+4/-5) lib/lp/translations/tests/test_side.py (+1/-1) lib/lp/translations/tests/test_suggestions.py (+5/-19) lib/lp/translations/tests/test_translatablemessage.py (+3/-2) lib/lp/translations/tests/test_translationmergejob.py (+2/-2) lib/lp/translations/tests/test_translationmerger.py (+8/-8) lib/lp/translations/tests/test_translationmessage.py (+2/-4) lib/lp/translations/tests/test_translations_to_review.py (+1/-1) |
To merge this branch: | bzr merge lp:~abentley/launchpad/pomessage-sequence |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+50344@code.launchpad.net |
Commit message
Fix factory.
Description of the change
= Summary =
A sequence number of 0 is a special value that means a POTMsgSet is obsolete, and so most tests that create POTMsgSets want a non-zero value. We should make that the default behaviour.
== Proposed fix ==
Use getUniqueInteger so that we get a non-zero sequence number.
== Pre-implementation notes ==
== Implementation details ==
Most tests that specify sequence=1 will work fine with any non-zero sequence number, and so they are changed to use the default sequence number instead.
A few tests that specify sequence=1 actually want 1 specifically, and those are retained.
Some tests create a POTMsgSet and then immediately set the sequence number. Those are changed to either specify the sequence in makePOTMsgSet, or accept the default, as above.
== Tests ==
bin/test -v
== Demo and Q/A ==
None
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
131: E301 expected 1 blank line, found 2
Abel Deuring (adeuring) : | # |
Preview Diff
1 | === modified file 'lib/lp/testing/factory.py' |
2 | --- lib/lp/testing/factory.py 2011-02-16 11:18:48 +0000 |
3 | +++ lib/lp/testing/factory.py 2011-02-18 15:15:35 +0000 |
4 | @@ -2721,10 +2721,12 @@ |
5 | create_sharing=create_sharing) |
6 | |
7 | def makePOTMsgSet(self, potemplate, singular=None, plural=None, |
8 | - context=None, sequence=0): |
9 | + context=None, sequence=None): |
10 | """Make a new `POTMsgSet` in the given template.""" |
11 | if singular is None and plural is None: |
12 | singular = self.getUniqueString() |
13 | + if sequence is None: |
14 | + sequence = self.getUniqueInteger() |
15 | potmsgset = potemplate.createMessageSetFromText( |
16 | singular, plural, context, sequence) |
17 | removeSecurityProxy(potmsgset).sync() |
18 | @@ -2769,7 +2771,7 @@ |
19 | if pofile is None: |
20 | pofile = self.makePOFile('sr') |
21 | if potmsgset is None: |
22 | - potmsgset = self.makePOTMsgSet(pofile.potemplate, sequence=1) |
23 | + potmsgset = self.makePOTMsgSet(pofile.potemplate) |
24 | if translator is None: |
25 | translator = self.makePerson() |
26 | translations = self.makeTranslationsDict(translations) |
27 | @@ -2827,7 +2829,7 @@ |
28 | if pofile is None: |
29 | pofile = self.makePOFile(language=language, side=side) |
30 | if potmsgset is None: |
31 | - potmsgset = self.makePOTMsgSet(pofile.potemplate, sequence=1) |
32 | + potmsgset = self.makePOTMsgSet(pofile.potemplate) |
33 | if translator is None: |
34 | translator = self.makePerson() |
35 | if reviewer is None: |
36 | |
37 | === modified file 'lib/lp/translations/tests/test_autoapproval.py' |
38 | --- lib/lp/translations/tests/test_autoapproval.py 2011-01-24 15:51:18 +0000 |
39 | +++ lib/lp/translations/tests/test_autoapproval.py 2011-02-18 15:15:35 +0000 |
40 | @@ -787,7 +787,7 @@ |
41 | template = self.factory.makePOTemplate( |
42 | productseries=trunk, translation_domain='domain') |
43 | template.iscurrent = True |
44 | - self.factory.makePOTMsgSet(template, "translator-credits", sequence=1) |
45 | + self.factory.makePOTMsgSet(template, "translator-credits") |
46 | |
47 | entry = self.queue.addOrUpdateEntry( |
48 | 'nl.po', '# ...', False, template.owner, productseries=trunk) |
49 | @@ -1055,7 +1055,7 @@ |
50 | trunk = self.product.getSeries('trunk') |
51 | template = self._makeTemplate(trunk) |
52 | credits = self.factory.makePOTMsgSet( |
53 | - template, singular='translation-credits', sequence=1) |
54 | + template, singular='translation-credits') |
55 | |
56 | entry = self._makeQueueEntry(trunk) |
57 | |
58 | |
59 | === modified file 'lib/lp/translations/tests/test_clearcurrenttranslation.py' |
60 | --- lib/lp/translations/tests/test_clearcurrenttranslation.py 2010-08-24 11:39:06 +0000 |
61 | +++ lib/lp/translations/tests/test_clearcurrenttranslation.py 2011-02-18 15:15:35 +0000 |
62 | @@ -80,7 +80,7 @@ |
63 | # will create an empty message so as to mark the review time. |
64 | pofile = self._makePOFile() |
65 | template = pofile.potemplate |
66 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
67 | + potmsgset = self.factory.makePOTMsgSet(template) |
68 | |
69 | potmsgset.clearCurrentTranslation(pofile, template.owner, ORIGIN) |
70 | |
71 | @@ -94,7 +94,7 @@ |
72 | pofile = self._makePOFile() |
73 | template = pofile.potemplate |
74 | traits = get_traits(template) |
75 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
76 | + potmsgset = self.factory.makePOTMsgSet(template) |
77 | tm = self._makeTranslationMessage(potmsgset, pofile) |
78 | traits.setFlag(tm, True) |
79 | self.assertTrue(traits.getFlag(tm)) |
80 | @@ -107,7 +107,7 @@ |
81 | pofile = self._makePOFile() |
82 | template = pofile.potemplate |
83 | traits = get_traits(template) |
84 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
85 | + potmsgset = self.factory.makePOTMsgSet(template) |
86 | tm = self._makeTranslationMessage(potmsgset, pofile, diverged=True) |
87 | traits.setFlag(tm, True) |
88 | |
89 | @@ -122,7 +122,7 @@ |
90 | pofile = self._makePOFile() |
91 | template = pofile.potemplate |
92 | traits = get_traits(template) |
93 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
94 | + potmsgset = self.factory.makePOTMsgSet(template) |
95 | shared_tm = self._makeTranslationMessage(potmsgset, pofile) |
96 | traits.setFlag(shared_tm, True) |
97 | diverged_tm = self._makeTranslationMessage( |
98 | @@ -145,7 +145,7 @@ |
99 | pofile = self._makePOFile() |
100 | template = pofile.potemplate |
101 | traits = get_traits(template) |
102 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
103 | + potmsgset = self.factory.makePOTMsgSet(template) |
104 | tm = self._makeTranslationMessage(potmsgset, pofile) |
105 | traits.setFlag(tm, True) |
106 | |
107 | @@ -162,7 +162,7 @@ |
108 | pofile = self._makePOFile() |
109 | template = pofile.potemplate |
110 | traits = get_traits(template) |
111 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
112 | + potmsgset = self.factory.makePOTMsgSet(template) |
113 | tm = self._makeTranslationMessage(potmsgset, pofile) |
114 | traits.setFlag(tm, True) |
115 | traits.other_side_traits.setFlag(tm, True) |
116 | @@ -176,7 +176,7 @@ |
117 | pofile = self._makePOFile() |
118 | template = pofile.potemplate |
119 | traits = get_traits(template) |
120 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
121 | + potmsgset = self.factory.makePOTMsgSet(template) |
122 | tm = self._makeTranslationMessage(potmsgset, pofile) |
123 | traits.setFlag(tm, True) |
124 | traits.other_side_traits.setFlag(tm, True) |
125 | @@ -191,7 +191,7 @@ |
126 | pofile = self._makePOFile() |
127 | template = pofile.potemplate |
128 | traits = get_traits(template) |
129 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
130 | + potmsgset = self.factory.makePOTMsgSet(template) |
131 | diverged_tm = self._makeTranslationMessage( |
132 | potmsgset, pofile, diverged=True) |
133 | traits.setFlag(diverged_tm, True) |
134 | @@ -211,7 +211,7 @@ |
135 | # review fields set. |
136 | pofile = self._makePOFile() |
137 | template = pofile.potemplate |
138 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
139 | + potmsgset = self.factory.makePOTMsgSet(template) |
140 | reviewer = self.factory.makePerson() |
141 | |
142 | potmsgset.clearCurrentTranslation(pofile, reviewer, ORIGIN) |
143 | @@ -229,7 +229,7 @@ |
144 | pofile = self._makePOFile() |
145 | template = pofile.potemplate |
146 | traits = get_traits(template) |
147 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
148 | + potmsgset = self.factory.makePOTMsgSet(template) |
149 | blank = self.factory.makeSuggestion( |
150 | potmsgset=potmsgset, pofile=pofile, translations=[]) |
151 | |
152 | |
153 | === modified file 'lib/lp/translations/tests/test_helpers.py' |
154 | --- lib/lp/translations/tests/test_helpers.py 2010-08-23 08:41:03 +0000 |
155 | +++ lib/lp/translations/tests/test_helpers.py 2011-02-18 15:15:35 +0000 |
156 | @@ -28,8 +28,7 @@ |
157 | distroseries=new_series, |
158 | sourcepackagename=sourcepackagename) |
159 | self.pofile = self.factory.makePOFile('sr', potemplate=potemplate) |
160 | - self.potmsgset = self.factory.makePOTMsgSet( |
161 | - potemplate=potemplate, sequence=1) |
162 | + self.potmsgset = self.factory.makePOTMsgSet(potemplate=potemplate) |
163 | |
164 | # A POFile in a different context from self.pofile. |
165 | self.other_pofile = self.factory.makePOFile( |
166 | |
167 | === modified file 'lib/lp/translations/tests/test_pofile.py' |
168 | --- lib/lp/translations/tests/test_pofile.py 2011-01-20 21:09:28 +0000 |
169 | +++ lib/lp/translations/tests/test_pofile.py 2011-02-18 15:15:35 +0000 |
170 | @@ -87,7 +87,7 @@ |
171 | |
172 | # The POTMsgSet is added to only one of the POTemplates. |
173 | self.potmsgset = self.factory.makePOTMsgSet( |
174 | - self.devel_potemplate, sequence=1) |
175 | + self.devel_potemplate) |
176 | |
177 | def test_getPOTMsgSetWithNewSuggestions_shared(self): |
178 | # Test listing of suggestions for POTMsgSets with a shared |
179 | @@ -248,7 +248,7 @@ |
180 | |
181 | # The POTMsgSet is added to only one of the POTemplates. |
182 | self.potmsgset = self.factory.makePOTMsgSet( |
183 | - self.devel_potemplate, sequence=1) |
184 | + self.devel_potemplate) |
185 | |
186 | def test_POFile_canonical_url(self): |
187 | # Test the canonical_url of the POFile. |
188 | @@ -266,8 +266,7 @@ |
189 | |
190 | # Searching for English strings. |
191 | potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
192 | - u"Some wild text") |
193 | - potmsgset.setSequence(self.devel_potemplate, 2) |
194 | + u"Some wild text", sequence=2) |
195 | |
196 | found_potmsgsets = list( |
197 | self.devel_pofile.findPOTMsgSetsContaining(u"wild")) |
198 | @@ -283,8 +282,8 @@ |
199 | # Searching for singular in plural messages works as well. |
200 | plural_potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
201 | u"Some singular text", |
202 | - u"Some plural text") |
203 | - plural_potmsgset.setSequence(self.devel_potemplate, 3) |
204 | + u"Some plural text", |
205 | + sequence=3) |
206 | |
207 | found_potmsgsets = list( |
208 | self.devel_pofile.findPOTMsgSetsContaining(u"singular")) |
209 | @@ -480,6 +479,7 @@ |
210 | def test_getPOTMsgSetTranslated_Multiple(self): |
211 | # Test listing of translated POTMsgSets if there is more than one |
212 | # translated message. |
213 | + self.potmsgset.setSequence(self.devel_potemplate, 1) |
214 | |
215 | # Add a diverged translation on the included POTMsgSet... |
216 | self.factory.makeCurrentTranslationMessage( |
217 | @@ -488,8 +488,7 @@ |
218 | |
219 | # and a shared translation on newly added POTMsgSet... |
220 | potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
221 | - u"Translated text") |
222 | - potmsgset.setSequence(self.devel_potemplate, 2) |
223 | + u"Translated text", sequence=2) |
224 | |
225 | self.factory.makeCurrentTranslationMessage( |
226 | pofile=self.devel_pofile, potmsgset=potmsgset, |
227 | @@ -589,6 +588,7 @@ |
228 | def test_getPOTMsgSetUntranslated_Multiple(self): |
229 | # Test listing of untranslated POTMsgSets if there is more than one |
230 | # untranslated message. |
231 | + self.potmsgset.setSequence(self.devel_potemplate, 1) |
232 | |
233 | # Add an empty translation to the included POTMsgSet... |
234 | self.factory.makeCurrentTranslationMessage( |
235 | @@ -597,8 +597,7 @@ |
236 | |
237 | # ...and a new untranslated POTMsgSet. |
238 | potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
239 | - u"Translated text") |
240 | - potmsgset.setSequence(self.devel_potemplate, 2) |
241 | + u"Translated text", sequence=2) |
242 | |
243 | # Both POTMsgSets are listed. |
244 | found_translations = list( |
245 | @@ -625,6 +624,7 @@ |
246 | |
247 | def test_getPOTMsgSetWithNewSuggestions_multiple(self): |
248 | # Test that multiple unreviewed POTMsgSets are returned. |
249 | + self.potmsgset.setSequence(self.devel_potemplate, 1) |
250 | |
251 | # One POTMsgSet has no translations, but only a suggestion. |
252 | self.factory.makeSuggestion( |
253 | @@ -633,8 +633,8 @@ |
254 | |
255 | # Another POTMsgSet has both a translation and a suggestion. |
256 | potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
257 | - u"Translated text") |
258 | - potmsgset.setSequence(self.devel_potemplate, 2) |
259 | + u"Translated text", |
260 | + sequence=2) |
261 | date_created = datetime.now(pytz.UTC) - timedelta(5) |
262 | self.factory.makeCurrentTranslationMessage( |
263 | pofile=self.devel_pofile, potmsgset=self.potmsgset, |
264 | @@ -774,15 +774,15 @@ |
265 | # First POTMsgSet (self.potmsgset) is untranslated. |
266 | |
267 | # Second POTMsgSet is untranslated, but with a suggestion. |
268 | - potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
269 | - potmsgset.setSequence(self.devel_potemplate, 2) |
270 | + potmsgset = self.factory.makePOTMsgSet( |
271 | + self.devel_potemplate, sequence=2) |
272 | self.factory.makeSuggestion( |
273 | pofile=self.devel_pofile, potmsgset=potmsgset, |
274 | translations=[u"Unreviewed suggestion"]) |
275 | |
276 | # Third POTMsgSet is translated, and with a suggestion. |
277 | - potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
278 | - potmsgset.setSequence(self.devel_potemplate, 3) |
279 | + potmsgset = self.factory.makePOTMsgSet( |
280 | + self.devel_potemplate, sequence=3) |
281 | update_date = datetime.now(pytz.UTC) - timedelta(1) |
282 | self.factory.makeCurrentTranslationMessage( |
283 | pofile=self.devel_pofile, potmsgset=potmsgset, |
284 | @@ -793,15 +793,15 @@ |
285 | translations=[u"Another suggestion"]) |
286 | |
287 | # Fourth POTMsgSet is translated in import. |
288 | - potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
289 | - potmsgset.setSequence(self.devel_potemplate, 4) |
290 | + potmsgset = self.factory.makePOTMsgSet( |
291 | + self.devel_potemplate, sequence=4) |
292 | self.factory.makeCurrentTranslationMessage( |
293 | pofile=self.devel_pofile, potmsgset=potmsgset, |
294 | translations=[u"Imported translation"], current_other=True) |
295 | |
296 | # Fifth POTMsgSet is translated in import, but changed in Ubuntu. |
297 | - potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
298 | - potmsgset.setSequence(self.devel_potemplate, 5) |
299 | + potmsgset = self.factory.makePOTMsgSet( |
300 | + self.devel_potemplate, sequence=5) |
301 | self.factory.makeCurrentTranslationMessage( |
302 | pofile=self.devel_pofile, potmsgset=potmsgset, |
303 | translations=[u"Imported translation"], current_other=True) |
304 | @@ -810,8 +810,8 @@ |
305 | translations=[u"LP translation"], current_other=False) |
306 | |
307 | # Sixth POTMsgSet is translated in LP only. |
308 | - potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
309 | - potmsgset.setSequence(self.devel_potemplate, 6) |
310 | + potmsgset = self.factory.makePOTMsgSet( |
311 | + self.devel_potemplate, sequence=6) |
312 | self.factory.makeCurrentTranslationMessage( |
313 | pofile=self.devel_pofile, potmsgset=potmsgset, |
314 | translations=[u"New translation"], current_other=False) |
315 | @@ -1013,7 +1013,7 @@ |
316 | self.potemplate = self.pofile.potemplate |
317 | |
318 | self.potmsgset = self.factory.makePOTMsgSet( |
319 | - potemplate=self.potemplate, sequence=1) |
320 | + potemplate=self.potemplate) |
321 | self.credits_potmsgset = self.factory.makePOTMsgSet( |
322 | potemplate=self.potemplate, singular=u'translator-credits') |
323 | |
324 | @@ -1189,10 +1189,10 @@ |
325 | |
326 | # Create two POTMsgSets that can be used to test in what order |
327 | # are they returned. Add them only to devel_potemplate sequentially. |
328 | - self.potmsgset1 = self.factory.makePOTMsgSet(self.devel_potemplate) |
329 | - self.potmsgset1.setSequence(self.devel_potemplate, 1) |
330 | - self.potmsgset2 = self.factory.makePOTMsgSet(self.devel_potemplate) |
331 | - self.potmsgset2.setSequence(self.devel_potemplate, 2) |
332 | + self.potmsgset1 = self.factory.makePOTMsgSet( |
333 | + self.devel_potemplate, sequence=1) |
334 | + self.potmsgset2 = self.factory.makePOTMsgSet( |
335 | + self.devel_potemplate, sequence=2) |
336 | |
337 | def test_getPOTMsgSetTranslated_ordering(self): |
338 | # Translate both POTMsgSets in devel_pofile, so |
339 | @@ -1551,7 +1551,7 @@ |
340 | # returned along with relevant POTMsgSets. |
341 | potemplate1 = self.factory.makePOTemplate() |
342 | self.factory.makePOTMsgSet( |
343 | - potemplate1, singular=u'translator-credits', sequence=1) |
344 | + potemplate1, singular=u'translator-credits') |
345 | |
346 | sr_pofile = self.factory.makePOFile('sr', potemplate=potemplate1) |
347 | self.assertIn(sr_pofile, |
348 | @@ -1572,7 +1572,7 @@ |
349 | potemplate2 = self.factory.makePOTemplate() |
350 | self.factory.makePOTMsgSet( |
351 | potemplate2, singular=u'Your names', |
352 | - context=u'NAME OF TRANSLATORS', sequence=1) |
353 | + context=u'NAME OF TRANSLATORS') |
354 | sr_kde_pofile = self.factory.makePOFile('sr', potemplate=potemplate2) |
355 | self.assertIn(sr_kde_pofile, |
356 | list_of_tuples_into_list( |
357 | @@ -1600,7 +1600,7 @@ |
358 | |
359 | potemplate = self.factory.makePOTemplate() |
360 | credits_potmsgset = self.factory.makePOTMsgSet( |
361 | - potemplate, singular=u'translator-credits', sequence=1) |
362 | + potemplate, singular=u'translator-credits') |
363 | pofile = self.factory.makePOFile(potemplate=potemplate) |
364 | |
365 | credits_translation = credits_potmsgset.getCurrentTranslation( |
366 | @@ -1747,8 +1747,7 @@ |
367 | |
368 | # Create a single POTMsgSet that is used across all tests, |
369 | # and add it to only one of the POTemplates. |
370 | - self.potmsgset = self.factory.makePOTMsgSet(self.potemplate, |
371 | - sequence=1) |
372 | + self.potmsgset = self.factory.makePOTMsgSet(self.potemplate) |
373 | |
374 | def test_POFile_updateStatistics_currentCount(self): |
375 | # Make sure count of translations which are active both |
376 | @@ -1849,7 +1848,7 @@ |
377 | |
378 | def test_makeTranslatableMessage(self): |
379 | # TranslatableMessages can be created from the PO file |
380 | - potmsgset = self.factory.makePOTMsgSet(self.potemplate, sequence=1) |
381 | + potmsgset = self.factory.makePOTMsgSet(self.potemplate) |
382 | message = self.pofile.makeTranslatableMessage(potmsgset) |
383 | verifyObject(ITranslatableMessage, message) |
384 | |
385 | @@ -2113,7 +2112,7 @@ |
386 | self.pofile = self.factory.makePOFile('eo') |
387 | self.potemplate = self.pofile.potemplate |
388 | self.potmsgset = self.factory.makePOTMsgSet( |
389 | - self.potemplate, sequence=1) |
390 | + self.potemplate) |
391 | |
392 | def test_getTranslationMessages_current_shared(self): |
393 | # A shared message is included in this POFile's messages. |
394 | @@ -2241,7 +2240,7 @@ |
395 | def _makePOFileWithPlural(self, language_code): |
396 | pofile = removeSecurityProxy(self.factory.makePOFile(language_code)) |
397 | self.factory.makePOTMsgSet( |
398 | - pofile.potemplate, singular=u"Foo", plural=u"Bar", sequence=1) |
399 | + pofile.potemplate, singular=u"Foo", plural=u"Bar") |
400 | return pofile |
401 | |
402 | def test_header_pluralform_equal(self): |
403 | @@ -2550,7 +2549,7 @@ |
404 | |
405 | def test_translatedCount_potmsgset_initial(self): |
406 | pofile = self.makePOFile() |
407 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
408 | + self.factory.makePOTMsgSet(pofile.potemplate) |
409 | self.exerciseFunction(pofile) |
410 | self.assertEqual(0, self.getTranslatedCount(pofile)) |
411 | |
412 | @@ -2590,7 +2589,7 @@ |
413 | # A shared current translation that is masked by a diverged one |
414 | # is not counted. |
415 | pofile = self.makePOFile() |
416 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
417 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
418 | self.factory.makeCurrentTranslationMessage( |
419 | pofile=pofile, potmsgset=potmsgset) |
420 | self.factory.makeDivergedTranslationMessage( |
421 | @@ -2601,7 +2600,7 @@ |
422 | |
423 | def test_untranslatedCount_potmsgset_initial(self): |
424 | pofile = self.makePOFile() |
425 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
426 | + self.factory.makePOTMsgSet(pofile.potemplate) |
427 | self.exerciseFunction(pofile) |
428 | self.assertEqual(1, self.getUntranslatedCount(pofile)) |
429 | |
430 | @@ -2643,7 +2642,7 @@ |
431 | # A shared current translation that is masked by a diverged one |
432 | # is only subtracted from the untranslatedCount once. |
433 | pofile = self.makePOFile() |
434 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
435 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
436 | self.factory.makeCurrentTranslationMessage( |
437 | pofile=pofile, potmsgset=potmsgset) |
438 | self.factory.makeDivergedTranslationMessage( |
439 | @@ -2657,7 +2656,7 @@ |
440 | |
441 | def test_currentCount_potmsgset_initial(self): |
442 | pofile = self.makePOFile() |
443 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
444 | + self.factory.makePOTMsgSet(pofile.potemplate) |
445 | self.exerciseFunction(pofile) |
446 | self.assertEqual(0, self.getCurrentCount(pofile)) |
447 | |
448 | @@ -2692,7 +2691,7 @@ |
449 | # A message that is translated differently in Ubuntu than |
450 | # upstream is not included in currentCount. |
451 | pofile = self.makePOFile() |
452 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
453 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
454 | self._makeOtherSideTranslation(pofile, potmsgset=potmsgset) |
455 | this_translation = self.factory.makeCurrentTranslationMessage( |
456 | pofile=pofile, potmsgset=potmsgset) |
457 | @@ -2703,7 +2702,7 @@ |
458 | # Diverging from a translation that's shared between Ubuntu and |
459 | # upstream decrements the currentCount. |
460 | pofile = self.makePOFile() |
461 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
462 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
463 | self.factory.makeCurrentTranslationMessage( |
464 | pofile=pofile, potmsgset=potmsgset, current_other=True) |
465 | self.factory.makeDivergedTranslationMessage( |
466 | @@ -2717,7 +2716,7 @@ |
467 | |
468 | def test_rosettaCount_potmsgset_initial(self): |
469 | pofile = self.makePOFile() |
470 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
471 | + self.factory.makePOTMsgSet(pofile.potemplate) |
472 | self.exerciseFunction(pofile) |
473 | self.assertEqual(0, self.getRosettaCount(pofile)) |
474 | |
475 | @@ -2766,7 +2765,7 @@ |
476 | # The rosettaCount does include messages that are translated |
477 | # differently on the two sides. |
478 | pofile = self.makePOFile() |
479 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
480 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
481 | self._makeOtherSideTranslation(pofile, potmsgset=potmsgset) |
482 | self.factory.makeCurrentTranslationMessage( |
483 | pofile=pofile, potmsgset=potmsgset) |
484 | @@ -2779,7 +2778,7 @@ |
485 | |
486 | def test_updatesCount_potmsgset_initial(self): |
487 | pofile = self.makePOFile() |
488 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
489 | + self.factory.makePOTMsgSet(pofile.potemplate) |
490 | self.exerciseFunction(pofile) |
491 | self.assertEqual(0, self.getUpdatesCount(pofile)) |
492 | |
493 | @@ -2787,7 +2786,7 @@ |
494 | # The updatesCount counts messages that are translated on the |
495 | # other side, but differently. |
496 | pofile = self.makePOFile() |
497 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
498 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
499 | self._makeOtherSideTranslation(pofile, potmsgset=potmsgset) |
500 | self.factory.makeCurrentTranslationMessage( |
501 | pofile=pofile, potmsgset=potmsgset) |
502 | @@ -2807,7 +2806,7 @@ |
503 | def test_updatesCount_diverged(self): |
504 | # Diverged messages can be part of the updatesCount. |
505 | pofile = self.makePOFile() |
506 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
507 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
508 | self.factory.makeCurrentTranslationMessage( |
509 | pofile=pofile, potmsgset=potmsgset, current_other=True) |
510 | self.factory.makeDivergedTranslationMessage( |
511 | @@ -2829,7 +2828,7 @@ |
512 | |
513 | def test_unreviewedCount_potmsgset_initial(self): |
514 | pofile = self.makePOFile() |
515 | - self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
516 | + self.factory.makePOTMsgSet(pofile.potemplate) |
517 | self.exerciseFunction(pofile) |
518 | self.assertEqual(0, self.getUnreviewedCount(pofile)) |
519 | |
520 | @@ -2853,7 +2852,7 @@ |
521 | # The unreviewedCount counts messages with unreviewed |
522 | # suggestions, not the suggestions themselves. |
523 | pofile = self.makePOFile() |
524 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
525 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
526 | self.factory.makeSuggestion(pofile=pofile, potmsgset=potmsgset) |
527 | self.factory.makeSuggestion(pofile=pofile, potmsgset=potmsgset) |
528 | self.exerciseFunction(pofile) |
529 | @@ -2863,7 +2862,7 @@ |
530 | # In order to affect the unreviewedCount, a suggestion has to be |
531 | # newer than the review date on the current translation. |
532 | pofile = self.makePOFile() |
533 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
534 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
535 | suggestion = self.factory.makeSuggestion( |
536 | pofile=pofile, potmsgset=potmsgset) |
537 | translation = self.factory.makeCurrentTranslationMessage( |
538 | @@ -2875,7 +2874,7 @@ |
539 | # Suggestions that are newer than the review date om the current |
540 | # translation are included in the unreviewedCount. |
541 | pofile = self.makePOFile() |
542 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
543 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
544 | translation = self.factory.makeCurrentTranslationMessage( |
545 | pofile=pofile, potmsgset=potmsgset) |
546 | translation.date_reviewed -= timedelta(1) |
547 | @@ -2889,7 +2888,7 @@ |
548 | # date on the current translation on this side also counts as an |
549 | # unreviewed suggestion on this side. |
550 | pofile = self.makePOFile() |
551 | - potmsgset = self.factory.makePOTMsgSet(pofile.potemplate, sequence=1) |
552 | + potmsgset = self.factory.makePOTMsgSet(pofile.potemplate) |
553 | this_translation = self.factory.makeCurrentTranslationMessage( |
554 | pofile=pofile, potmsgset=potmsgset) |
555 | this_translation.date_reviewed -= timedelta(1) |
556 | |
557 | === modified file 'lib/lp/translations/tests/test_potmsgset.py' |
558 | --- lib/lp/translations/tests/test_potmsgset.py 2011-02-17 14:16:17 +0000 |
559 | +++ lib/lp/translations/tests/test_potmsgset.py 2011-02-18 15:15:35 +0000 |
560 | @@ -69,7 +69,7 @@ |
561 | # Create a single POTMsgSet that is used across all tests, |
562 | # and add it to only one of the POTemplates. |
563 | self.potmsgset = self.factory.makePOTMsgSet( |
564 | - self.devel_potemplate, sequence=1) |
565 | + self.devel_potemplate) |
566 | |
567 | def _refreshSuggestiveTemplatesCache(self): |
568 | """Refresh the `SuggestivePOTemplate` cache.""" |
569 | @@ -351,8 +351,7 @@ |
570 | product = external_template.productseries.product |
571 | product.translations_usage = ServiceUsage.LAUNCHPAD |
572 | external_potmsgset = self.factory.makePOTMsgSet( |
573 | - external_template, singular=self.potmsgset.singular_text, |
574 | - sequence=1) |
575 | + external_template, singular=self.potmsgset.singular_text) |
576 | external_pofile = self.factory.makePOFile( |
577 | potemplate=external_template) |
578 | language = external_pofile.language |
579 | @@ -409,8 +408,7 @@ |
580 | product = external_template.productseries.product |
581 | product.translations_usage = ServiceUsage.LAUNCHPAD |
582 | external_potmsgset = self.factory.makePOTMsgSet( |
583 | - external_template, singular=self.potmsgset.singular_text, |
584 | - sequence=1) |
585 | + external_template, singular=self.potmsgset.singular_text) |
586 | external_pofile = self.factory.makePOFile( |
587 | potemplate=external_template) |
588 | language = external_pofile.language |
589 | @@ -631,8 +629,7 @@ |
590 | |
591 | self.potemplate = self.factory.makePOTemplate( |
592 | productseries=self.foo_main, name="messages") |
593 | - self.potmsgset = self.factory.makePOTMsgSet(self.potemplate, |
594 | - sequence=1) |
595 | + self.potmsgset = self.factory.makePOTMsgSet(self.potemplate) |
596 | self.pofile = self.factory.makePOFile('eo', self.potemplate) |
597 | # Set up some translation messages with dummy timestamps that will be |
598 | # changed in the tests. |
599 | @@ -830,7 +827,7 @@ |
600 | |
601 | template = self.potemplate = self.factory.makePOTemplate( |
602 | productseries=self.foo_main, name="messages") |
603 | - self.potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
604 | + self.potmsgset = self.factory.makePOTMsgSet(template) |
605 | self.pofile = self.factory.makePOFile('eo', template) |
606 | |
607 | def test_resetCurrentTranslation_shared(self): |
608 | @@ -960,8 +957,7 @@ |
609 | """ |
610 | potemplate = self.factory.makePOTemplate(productseries=productseries) |
611 | potemplate.source_file_format = format |
612 | - potmsgset = self.factory.makePOTMsgSet( |
613 | - potemplate, msgid_text, sequence=1) |
614 | + potmsgset = self.factory.makePOTMsgSet(potemplate, msgid_text) |
615 | return (potmsgset, potemplate) |
616 | |
617 | def _makePOTMsgSet(self, msgid_text, format, productseries=None): |
618 | @@ -1101,7 +1097,7 @@ |
619 | sr_pofile = self.factory.makePOFile('sr', potemplate=self.potemplate) |
620 | |
621 | credits = self.factory.makePOTMsgSet( |
622 | - self.potemplate, u'translator-credits', sequence=1) |
623 | + self.potemplate, u'translator-credits') |
624 | |
625 | eo_translation = credits.getCurrentTranslation( |
626 | self.potemplate, eo_pofile.language, |
627 | @@ -1120,7 +1116,7 @@ |
628 | # Normal messages do not receive a dummy translation. |
629 | eo_pofile = self.factory.makePOFile('eo', potemplate=self.potemplate) |
630 | |
631 | - potmsgset = self.factory.makePOTMsgSet(self.potemplate, sequence=1) |
632 | + potmsgset = self.factory.makePOTMsgSet(self.potemplate) |
633 | eo_translation = potmsgset.getCurrentTranslation( |
634 | self.potemplate, eo_pofile.language, |
635 | self.potemplate.translation_side) |
636 | @@ -1133,7 +1129,7 @@ |
637 | imported_credits = u'Imported credits.' |
638 | |
639 | credits = self.factory.makePOTMsgSet( |
640 | - self.potemplate, u'translator-credits', sequence=1) |
641 | + self.potemplate, u'translator-credits') |
642 | self.factory.makeCurrentTranslationMessage( |
643 | eo_pofile, credits, translations=[imported_credits], |
644 | current_other=True) |
645 | @@ -1149,7 +1145,7 @@ |
646 | # all translation credits messages. |
647 | |
648 | credits = self.factory.makePOTMsgSet( |
649 | - self.potemplate, u'translator-credits', sequence=1) |
650 | + self.potemplate, u'translator-credits') |
651 | eo_pofile = self.factory.makePOFile('eo', potemplate=self.potemplate) |
652 | |
653 | eo_translation = credits.getCurrentTranslation( |
654 | @@ -1727,7 +1723,7 @@ |
655 | # If there is no current translation, _checkForConflict accepts |
656 | # that as conflict-free. |
657 | potemplate = self.factory.makePOTemplate() |
658 | - potmsgset = self.factory.makePOTMsgSet(potemplate, sequence=1) |
659 | + potmsgset = self.factory.makePOTMsgSet(potemplate) |
660 | old = datetime.now(pytz.UTC) - timedelta(days=366) |
661 | |
662 | removeSecurityProxy(potmsgset)._checkForConflict(None, old) |
663 | |
664 | === modified file 'lib/lp/translations/tests/test_setcurrenttranslation.py' |
665 | --- lib/lp/translations/tests/test_setcurrenttranslation.py 2011-02-15 10:28:29 +0000 |
666 | +++ lib/lp/translations/tests/test_setcurrenttranslation.py 2011-02-18 15:15:35 +0000 |
667 | @@ -1161,7 +1161,7 @@ |
668 | language_code=self.pofile.language.code) |
669 | |
670 | self.potmsgset = self.factory.makePOTMsgSet( |
671 | - potemplate=potemplate, sequence=1) |
672 | + potemplate=potemplate) |
673 | |
674 | def selectUpstreamTranslation(self, tm, tm_other): |
675 | # See `SetCurrentTranslationTestMixin` |
676 | @@ -1201,7 +1201,7 @@ |
677 | language_code=self.pofile.language.code) |
678 | |
679 | self.potmsgset = self.factory.makePOTMsgSet( |
680 | - potemplate=potemplate, sequence=1) |
681 | + potemplate=potemplate) |
682 | |
683 | def selectUpstreamTranslation(self, tm, tm_other): |
684 | # See `SetCurrentTranslationTestMixin` |
685 | |
686 | === modified file 'lib/lp/translations/tests/test_shared_potemplate.py' |
687 | --- lib/lp/translations/tests/test_shared_potemplate.py 2011-02-14 17:14:17 +0000 |
688 | +++ lib/lp/translations/tests/test_shared_potemplate.py 2011-02-18 15:15:35 +0000 |
689 | @@ -44,7 +44,6 @@ |
690 | # Create a single POTMsgSet that is used across all tests, |
691 | # and add it to only one of the POTemplates. |
692 | self.potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate) |
693 | - self.potmsgset.setSequence(self.devel_potemplate, 1) |
694 | |
695 | def test_getPOTMsgSets(self): |
696 | self.potmsgset.setSequence(self.stable_potemplate, 1) |
697 | @@ -116,8 +115,8 @@ |
698 | # Let's add a POTMsgSet with plural forms. |
699 | plural_potmsgset = self.factory.makePOTMsgSet(self.devel_potemplate, |
700 | singular="singular", |
701 | - plural="plural") |
702 | - plural_potmsgset.setSequence(self.devel_potemplate, 4) |
703 | + plural="plural", |
704 | + sequence=4) |
705 | |
706 | # Now, template contains a plural form message. |
707 | self.assertEquals(self.devel_potemplate.hasPluralMessage(), True) |
708 | @@ -662,7 +661,7 @@ |
709 | distroseries=self.hoary) |
710 | self.trunk.setPackaging(self.hoary, self.packagename, self.owner) |
711 | hoary_potmsgset = self.factory.makePOTMsgSet( |
712 | - potemplate=self.hoary_template, sequence=1) |
713 | + potemplate=self.hoary_template) |
714 | |
715 | trunk_potmsgset = self.trunk_template.getOrCreateSharedPOTMsgSet( |
716 | singular_text=hoary_potmsgset.singular_text, |
717 | @@ -676,7 +675,7 @@ |
718 | self.packagename, self.hoary) |
719 | sourcepackage.setPackaging(self.trunk, self.owner) |
720 | trunk_potmsgset = self.factory.makePOTMsgSet( |
721 | - potemplate=self.trunk_template, sequence=1) |
722 | + potemplate=self.trunk_template) |
723 | |
724 | hoary_potmsgset = self.trunk_template.getOrCreateSharedPOTMsgSet( |
725 | singular_text=trunk_potmsgset.singular_text, |
726 | |
727 | === modified file 'lib/lp/translations/tests/test_side.py' |
728 | --- lib/lp/translations/tests/test_side.py 2010-09-01 11:35:47 +0000 |
729 | +++ lib/lp/translations/tests/test_side.py 2011-02-18 15:15:35 +0000 |
730 | @@ -85,7 +85,7 @@ |
731 | """ |
732 | template = self._makeTemplate() |
733 | pofile = self.factory.makePOFile('nl', template) |
734 | - potmsgset = self.factory.makePOTMsgSet(template, sequence=1) |
735 | + potmsgset = self.factory.makePOTMsgSet(template) |
736 | translationmessage = potmsgset.submitSuggestion( |
737 | pofile, self.factory.makePerson(), |
738 | {0: self.factory.getUniqueString()}) |
739 | |
740 | === modified file 'lib/lp/translations/tests/test_suggestions.py' |
741 | --- lib/lp/translations/tests/test_suggestions.py 2010-12-31 15:39:19 +0000 |
742 | +++ lib/lp/translations/tests/test_suggestions.py 2011-02-18 15:15:35 +0000 |
743 | @@ -19,10 +19,6 @@ |
744 | from lp.services.worlddata.interfaces.language import ILanguageSet |
745 | from lp.testing import TestCaseWithFactory |
746 | from lp.translations.interfaces.potemplate import IPOTemplateSet |
747 | -from lp.translations.interfaces.translationmessage import ( |
748 | - TranslationValidationStatus, |
749 | - ) |
750 | -from lp.translations.utilities.validate import GettextValidationError |
751 | |
752 | |
753 | class TestTranslationSuggestions(TestCaseWithFactory): |
754 | @@ -63,7 +59,6 @@ |
755 | # translations for it, there are no suggestions for translating |
756 | # it whatsoever. |
757 | potmsgset = self.factory.makePOTMsgSet(self.foo_template) |
758 | - potmsgset.setSequence(self.foo_template, 1) |
759 | self.assertEquals( |
760 | potmsgset.getExternallyUsedTranslationMessages(self.nl), []) |
761 | self.assertEquals( |
762 | @@ -75,9 +70,7 @@ |
763 | # suggestion. |
764 | text = "error message 936" |
765 | foomsg = self.factory.makePOTMsgSet(self.foo_template, text) |
766 | - foomsg.setSequence(self.foo_template, 1) |
767 | barmsg = self.factory.makePOTMsgSet(self.bar_template, text) |
768 | - barmsg.setSequence(self.bar_template, 1) |
769 | translation = self.factory.makeCurrentTranslationMessage( |
770 | pofile=self.bar_nl, current_other=False, potmsgset=barmsg) |
771 | |
772 | @@ -98,9 +91,7 @@ |
773 | # If global suggestions are disabled, empty list is returned. |
774 | text = "error message 936" |
775 | foomsg = self.factory.makePOTMsgSet(self.foo_template, text) |
776 | - foomsg.setSequence(self.foo_template, 1) |
777 | barmsg = self.factory.makePOTMsgSet(self.bar_template, text) |
778 | - barmsg.setSequence(self.bar_template, 1) |
779 | translation = self.factory.makeCurrentTranslationMessage( |
780 | pofile=self.bar_nl, current_other=False, potmsgset=barmsg) |
781 | |
782 | @@ -127,11 +118,9 @@ |
783 | # Suggestions made for bar can also be useful suggestions for foo. |
784 | text = "Welcome to our application! We hope to have code soon." |
785 | foomsg = self.factory.makePOTMsgSet(self.foo_template, text) |
786 | - foomsg.setSequence(self.foo_template, 1) |
787 | barmsg = self.factory.makePOTMsgSet(self.bar_template, text) |
788 | - barmsg.setSequence(self.bar_template, 1) |
789 | suggestion = barmsg.submitSuggestion( |
790 | - self.bar_nl, self.foo_template.owner, { 0: "Noueh hallo dus." }) |
791 | + self.bar_nl, self.foo_template.owner, {0: "Noueh hallo dus."}) |
792 | |
793 | transaction.commit() |
794 | |
795 | @@ -151,15 +140,13 @@ |
796 | before = now - timedelta(1, 1, 1) |
797 | |
798 | foomsg = self.factory.makePOTMsgSet(self.foo_template, text) |
799 | - foomsg.setSequence(self.foo_template, 1) |
800 | barmsg = self.factory.makePOTMsgSet(self.bar_template, text) |
801 | - barmsg.setSequence(self.bar_template, 1) |
802 | suggestion1 = self.factory.makeCurrentTranslationMessage( |
803 | pofile=self.bar_nl, potmsgset=foomsg, |
804 | - translations={ 0: suggested_dutch }) |
805 | + translations={0: suggested_dutch}) |
806 | suggestion2 = self.factory.makeCurrentTranslationMessage( |
807 | pofile=self.bar_nl, potmsgset=barmsg, |
808 | - translations={ 0: suggested_dutch }) |
809 | + translations={0: suggested_dutch}) |
810 | self.assertNotEqual(suggestion1, suggestion2) |
811 | removeSecurityProxy(suggestion1).date_created = before |
812 | removeSecurityProxy(suggestion2).date_created = before |
813 | @@ -170,7 +157,6 @@ |
814 | oof_template = self.factory.makePOTemplate() |
815 | oof_potmsgset = self.factory.makePOTMsgSet( |
816 | oof_template, singular=text) |
817 | - oof_potmsgset.setSequence(oof_template, 1) |
818 | from storm.store import Store |
819 | Store.of(oof_template).flush() |
820 | transaction.commit() |
821 | @@ -188,11 +174,11 @@ |
822 | potmsgset = self.factory.makePOTMsgSet(self.foo_template) |
823 | suggestion1 = self.factory.makeCurrentTranslationMessage( |
824 | pofile=self.foo_nl, potmsgset=potmsgset, |
825 | - translations={ 0 : translated_in_ubuntu }, |
826 | + translations={0: translated_in_ubuntu}, |
827 | current_other=False) |
828 | suggestion2 = self.factory.makeCurrentTranslationMessage( |
829 | pofile=self.foo_nl, potmsgset=potmsgset, |
830 | - translations={ 0 : translated_upstream }, |
831 | + translations={0: translated_upstream}, |
832 | current_other=True) |
833 | ubuntu_translation = potmsgset.getCurrentTranslation( |
834 | self.foo_template, self.foo_nl.language, |
835 | |
836 | === modified file 'lib/lp/translations/tests/test_translatablemessage.py' |
837 | --- lib/lp/translations/tests/test_translatablemessage.py 2010-12-16 13:25:54 +0000 |
838 | +++ lib/lp/translations/tests/test_translatablemessage.py 2011-02-18 15:15:35 +0000 |
839 | @@ -39,7 +39,7 @@ |
840 | self.potemplate = self.factory.makePOTemplate( |
841 | productseries=self.trunk) |
842 | self.potmsgset = self.factory.makePOTMsgSet( |
843 | - potemplate=self.potemplate, sequence=1) |
844 | + potemplate=self.potemplate) |
845 | self.pofile = self.factory.makePOFile( |
846 | potemplate=self.potemplate, language_code='eo') |
847 | |
848 | @@ -76,6 +76,7 @@ |
849 | def test_sequence(self): |
850 | # After instantiation, the sequence number from the potmsgset is |
851 | # available. |
852 | + self.potmsgset.setSequence(self.potemplate, 1) |
853 | message = TranslatableMessage(self.potmsgset, self.pofile) |
854 | self.assertEqual(1, message.sequence) |
855 | |
856 | @@ -156,7 +157,7 @@ |
857 | product.translations_usage = ServiceUsage.LAUNCHPAD |
858 | self.external_potmsgset = self.factory.makePOTMsgSet( |
859 | potemplate=self.external_potemplate, |
860 | - singular=common_msgid, sequence=1) |
861 | + singular=common_msgid) |
862 | self.external_pofile = self.factory.makePOFile( |
863 | potemplate=self.external_potemplate, language_code='eo') |
864 | |
865 | |
866 | === modified file 'lib/lp/translations/tests/test_translationmergejob.py' |
867 | --- lib/lp/translations/tests/test_translationmergejob.py 2011-02-11 20:48:57 +0000 |
868 | +++ lib/lp/translations/tests/test_translationmergejob.py 2011-02-18 15:15:35 +0000 |
869 | @@ -28,7 +28,7 @@ |
870 | upstream_pofile = factory.makePOFile( |
871 | side=TranslationSide.UPSTREAM) |
872 | upstream_potmsgset = factory.makePOTMsgSet( |
873 | - upstream_pofile.potemplate, singular, sequence=1) |
874 | + upstream_pofile.potemplate, singular) |
875 | upstream = factory.makeCurrentTranslationMessage( |
876 | pofile=upstream_pofile, potmsgset=upstream_potmsgset) |
877 | ubuntu_potemplate = factory.makePOTemplate( |
878 | @@ -36,7 +36,7 @@ |
879 | ubuntu_pofile = factory.makePOFile( |
880 | potemplate=ubuntu_potemplate, language=upstream_pofile.language) |
881 | ubuntu_potmsgset = factory.makePOTMsgSet( |
882 | - ubuntu_pofile.potemplate, singular, sequence=1) |
883 | + ubuntu_pofile.potemplate, singular) |
884 | ubuntu = factory.makeCurrentTranslationMessage( |
885 | pofile=ubuntu_pofile, potmsgset=ubuntu_potmsgset, |
886 | translations=upstream.translations) |
887 | |
888 | === modified file 'lib/lp/translations/tests/test_translationmerger.py' |
889 | --- lib/lp/translations/tests/test_translationmerger.py 2011-02-14 14:42:46 +0000 |
890 | +++ lib/lp/translations/tests/test_translationmerger.py 2011-02-18 15:15:35 +0000 |
891 | @@ -76,9 +76,9 @@ |
892 | # sharing templates had matching POTMsgSets, they will share |
893 | # one. |
894 | trunk_potmsgset = self.factory.makePOTMsgSet( |
895 | - self.trunk_template, singular='foo', sequence=1) |
896 | + self.trunk_template, singular='foo') |
897 | stable_potmsgset = self.factory.makePOTMsgSet( |
898 | - self.stable_template, singular='foo', sequence=1) |
899 | + self.stable_template, singular='foo') |
900 | |
901 | self.merger.mergePOTMsgSets() |
902 | |
903 | @@ -92,9 +92,9 @@ |
904 | # merge_potmsgsets can be run again on a situation it's |
905 | # produced. It will produce the same situation. |
906 | trunk_potmsgset = self.factory.makePOTMsgSet( |
907 | - self.trunk_template, singular='foo', sequence=1) |
908 | + self.trunk_template, singular='foo') |
909 | stable_potmsgset = self.factory.makePOTMsgSet( |
910 | - self.stable_template, singular='foo', sequence=1) |
911 | + self.stable_template, singular='foo') |
912 | |
913 | self.merger.mergePOTMsgSets() |
914 | self.merger.mergePOTMsgSets() |
915 | @@ -108,9 +108,9 @@ |
916 | def test_unmatchedPOTMsgSetsDoNotShare(self): |
917 | # Only identically-keyed potmsgsets get merged. |
918 | trunk_potmsgset = self.factory.makePOTMsgSet( |
919 | - self.trunk_template, singular='foo', sequence=1) |
920 | + self.trunk_template, singular='foo') |
921 | stable_potmsgset = self.factory.makePOTMsgSet( |
922 | - self.stable_template, singular='foo', context='bar', sequence=1) |
923 | + self.stable_template, singular='foo', context='bar') |
924 | |
925 | self.merger.mergePOTMsgSets() |
926 | |
927 | @@ -152,10 +152,10 @@ |
928 | super(TranslatedProductMixin, self).setUpProduct() |
929 | |
930 | self.trunk_potmsgset = self.factory.makePOTMsgSet( |
931 | - self.trunk_template, singular='foo', sequence=1) |
932 | + self.trunk_template, singular='foo') |
933 | |
934 | self.stable_potmsgset = self.factory.makePOTMsgSet( |
935 | - self.stable_template, singular='foo', sequence=1) |
936 | + self.stable_template, singular='foo') |
937 | |
938 | self.msgid = self.trunk_potmsgset.msgid_singular |
939 | |
940 | |
941 | === modified file 'lib/lp/translations/tests/test_translationmessage.py' |
942 | --- lib/lp/translations/tests/test_translationmessage.py 2011-02-15 12:07:51 +0000 |
943 | +++ lib/lp/translations/tests/test_translationmessage.py 2011-02-18 15:15:35 +0000 |
944 | @@ -810,11 +810,9 @@ |
945 | self.other_template = self.factory.makePOTemplate( |
946 | productseries=self.trunk, name="other") |
947 | self.potmsgset = self.factory.makePOTMsgSet( |
948 | - potemplate=self.template, singular='foo', plural='foos', |
949 | - sequence=1) |
950 | + potemplate=self.template, singular='foo', plural='foos') |
951 | self.other_potmsgset = self.factory.makePOTMsgSet( |
952 | - potemplate=self.other_template, singular='bar', plural='bars', |
953 | - sequence=1) |
954 | + potemplate=self.other_template, singular='bar', plural='bars') |
955 | self.pofile = self.factory.makePOFile( |
956 | potemplate=self.template, language_code='nl') |
957 | self.other_pofile = self.factory.makePOFile( |
958 | |
959 | === modified file 'lib/lp/translations/tests/test_translations_to_review.py' |
960 | --- lib/lp/translations/tests/test_translations_to_review.py 2010-12-09 19:49:36 +0000 |
961 | +++ lib/lp/translations/tests/test_translations_to_review.py 2011-02-18 15:15:35 +0000 |
962 | @@ -78,7 +78,7 @@ |
963 | self.pofile = removeSecurityProxy(self.factory.makePOFile( |
964 | potemplate=self.potemplate, language_code='nl')) |
965 | self.potmsgset = self.factory.makePOTMsgSet( |
966 | - potemplate=self.potemplate, singular='hi', sequence=1) |
967 | + potemplate=self.potemplate, singular='hi') |
968 | self.translation = self.factory.makeCurrentTranslationMessage( |
969 | potmsgset=self.potmsgset, pofile=self.pofile, |
970 | translator=self.person, translations=['bi'], |