diff --git a/murano/db/catalog/api.py b/murano/db/catalog/api.py index 1d560018..66334202 100644 --- a/murano/db/catalog/api.py +++ b/murano/db/catalog/api.py @@ -324,7 +324,7 @@ def package_search(filters, context, limit=None, catalog=False): sort_keys = [SEARCH_MAPPING[sort_key] for sort_key in filters.get('order_by', ['name'])] - + sort_keys.append('id') marker = filters.get('marker') sort_dir = filters.get('sort_dir') diff --git a/murano/tests/unit/db/test_catalog.py b/murano/tests/unit/db/test_catalog.py index 7615e1cd..cdf223ae 100644 --- a/murano/tests/unit/db/test_catalog.py +++ b/murano/tests/unit/db/test_catalog.py @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import uuid from oslo_db import exception as db_exception @@ -181,16 +180,16 @@ class CatalogDBTestCase(base.MuranoWithDBTestCase): res = api.package_search({'marker': marker}, self.context, limit=4) self.assertEqual(len(res), 0) - @unittest.expectedFailure def test_pagination_loops_through_names(self): - """Creates 10 packages with the same name and iterates through them, + """Creates 10 packages with the same display name and iterates through them, checking that package are not skipped. """ - # TODO(kzaitsev): fix https://bugs.launchpad.net/murano/+bug/1448782 for dummy in range(10): - api.package_upload(self._stub_package( - fully_qualified_name=str(uuid.uuid4())), self.tenant_id) + api.package_upload( + self._stub_package(name='test', + fully_qualified_name=str(uuid.uuid4())), + self.tenant_id) res = api.package_search({}, self.context, limit=4) self.assertEqual(len(res), 4) marker = res[-1].id