272
272
package_sets.values()[0][0].name,
273
273
complete_upload.display_package_sets)
275
def test_display_package_sets_returns_empty_for_non_source_upload(self):
275
def test_display_package_sets_returns_empty_for_other_upload(self):
276
276
upload = self.factory.makeBuildPackageUpload()
277
277
complete_upload = self.makeCompletePackageUpload(
278
278
upload, package_sets=self.mapPackageSets(upload))
287
287
self.assertEqual("aaa bbb ccc", complete_upload.display_package_sets)
289
289
def test_display_component_returns_source_upload_component_name(self):
290
complete_upload = self.makeCompletePackageUpload()
292
complete_upload.sourcepackagerelease.component.name.lower(),
293
complete_upload.display_component)
295
def test_display_component_returns_empty_for_non_source_upload(self):
290
upload = self.factory.makeSourcePackageUpload()
291
complete_upload = self.makeCompletePackageUpload(upload)
293
upload.sourcepackagerelease.component.name.lower(),
294
complete_upload.display_component)
296
def test_display_component_returns_copy_job_upload_component_name(self):
297
copy_job_upload = self.factory.makeCopyJobPackageUpload()
298
complete_upload = self.makeCompletePackageUpload(copy_job_upload)
300
copy_job_upload.component_name.lower(),
301
complete_upload.display_component)
303
def test_display_component_returns_empty_for_other_upload(self):
296
304
complete_upload = self.makeCompletePackageUpload(
297
305
self.factory.makeBuildPackageUpload())
298
306
self.assertEqual('', complete_upload.display_component)
300
308
def test_display_section_returns_source_upload_section_name(self):
301
complete_upload = self.makeCompletePackageUpload()
303
complete_upload.sourcepackagerelease.section.name.lower(),
304
complete_upload.display_section)
306
def test_display_section_returns_empty_for_non_source_upload(self):
309
upload = self.factory.makeSourcePackageUpload()
310
complete_upload = self.makeCompletePackageUpload(upload)
312
upload.sourcepackagerelease.section.name.lower(),
313
complete_upload.display_section)
315
def test_display_section_returns_copy_job_upload_section_name(self):
316
copy_job_upload = self.factory.makeCopyJobPackageUpload()
317
complete_upload = self.makeCompletePackageUpload(copy_job_upload)
319
copy_job_upload.section_name.lower(),
320
complete_upload.display_section)
322
def test_display_section_returns_empty_for_other_upload(self):
307
323
complete_upload = self.makeCompletePackageUpload(
308
324
self.factory.makeBuildPackageUpload())
309
325
self.assertEqual('', complete_upload.display_section)
311
327
def test_display_priority_returns_source_upload_priority(self):
312
complete_upload = self.makeCompletePackageUpload()
328
upload = self.factory.makeSourcePackageUpload()
329
complete_upload = self.makeCompletePackageUpload(upload)
313
330
self.assertEqual(
314
complete_upload.sourcepackagerelease.urgency.name.lower(),
331
upload.sourcepackagerelease.urgency.name.lower(),
315
332
complete_upload.display_priority)
317
def test_display_priority_returns_empty_for_non_source_upload(self):
334
def test_display_priority_returns_empty_for_other_upload(self):
318
335
complete_upload = self.makeCompletePackageUpload(
319
336
self.factory.makeBuildPackageUpload())
320
337
self.assertEqual('', complete_upload.display_priority)