~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/test_distroseries.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-04 18:33:35 UTC
  • mfrom: (13607.2.2 bug-820900)
  • Revision ID: launchpad@pqm.canonical.com-20110804183335-81w3lyus7i0xof1u
[r=allenap][bug=820900] Display an error when the filtering option
        passed is not a valid key.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1637
1637
 
1638
1638
        self.assertContentEqual(diffs, all_view.cached_differences.batch)
1639
1639
 
 
1640
    def test_batch_wrong_param(self):
 
1641
        # If a wrong parameter is passed then an error is displayed
 
1642
        # and no differences are shown.
 
1643
        set_derived_series_ui_feature_flag(self)
 
1644
        derived_series, parent_series = self._createChildAndParent()
 
1645
        self.factory.makeDistroSeriesDifference(
 
1646
            derived_series=derived_series,
 
1647
            source_package_name_str="my-src-package")
 
1648
        view = create_initialized_view(
 
1649
            derived_series,
 
1650
            '+localpackagediffs',
 
1651
            query_string='field.package_type=%s' % 'unexpected')
 
1652
        view()  # Render the view.
 
1653
 
 
1654
        self.assertEqual('Invalid option', view.getFieldError('package_type'))
 
1655
        self.assertContentEqual([], view.cached_differences.batch)
 
1656
 
1640
1657
    def test_batch_blacklisted_differences_with_higher_version(self):
1641
1658
        # field.package_type parameter allows to list only
1642
1659
        # blacklisted differences with a child's version higher than parent's.