diff --git a/tests/unit/organizations/test_services.py b/tests/unit/organizations/test_services.py index 79a5a030f00a..78c67e965d1e 100644 --- a/tests/unit/organizations/test_services.py +++ b/tests/unit/organizations/test_services.py @@ -136,10 +136,10 @@ def test_approve_organization_application( assert organization_service.get_organization_applications_by_name( organization_application.name - ) == [organization_application, competing_organization_application] + ) == sorted([organization_application, competing_organization_application]) assert organization_service.get_organization_applications_by_name( organization_application.name, undecided=True - ) == [organization_application, competing_organization_application] + ) == sorted([organization_application, competing_organization_application]) assert ( organization_service.get_organization_by_name(organization_application.name) diff --git a/warehouse/organizations/models.py b/warehouse/organizations/models.py index bd27dc1e8526..8703060fbd3f 100644 --- a/warehouse/organizations/models.py +++ b/warehouse/organizations/models.py @@ -486,6 +486,9 @@ class OrganizationApplication(OrganizationMixin, db.Model): back_populates="application", viewonly=True ) + def __lt__(self, other: OrganizationApplication) -> bool: + return self.name < other.name + class OrganizationNameCatalog(db.Model): __tablename__ = "organization_name_catalog"