Skip to content

Commit

Permalink
Remove unused Group.created_by() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond authored and seanh committed Oct 1, 2024
1 parent 7ce59ed commit ff3d47f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
5 changes: 0 additions & 5 deletions h/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,6 @@ def is_public(self):
def __repr__(self):
return f"<Group: {self.slug}>"

@classmethod
def created_by(cls, session, user):
"""Return a query object filtering groups by creator."""
return session.query(cls).filter(Group.creator == user)


TypeFlags = namedtuple("TypeFlags", "joinable_by readable_by writeable_by")

Expand Down
24 changes: 0 additions & 24 deletions tests/unit/h/models/group_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,30 +206,6 @@ def test_group_organization(db_session):
assert group.organization_id == org.id


def test_created_by(db_session, factories, organization):
name_1 = "My first group"
name_2 = "My second group"
user = factories.User()

group_1 = models.Group(
name=name_1,
authority="foobar.com",
creator=user,
organization=organization,
)
group_2 = models.Group(
name=name_2,
authority="foobar.com",
creator=user,
organization=organization,
)

db_session.add_all([group_1, group_2])
db_session.flush()

assert models.Group.created_by(db_session, user).all() == [group_1, group_2]


def test_public_group():
group = models.Group(readable_by=ReadableBy.world)

Expand Down

0 comments on commit ff3d47f

Please sign in to comment.