def test_user_from_other_team_cant_delete(self, logged_in_user, client, team): other_team = TeamFactory() tab_item = TabItemFactory( team=other_team, person=PersonFactory(team=other_team), adder=UserFactory( memberships=[TeamMembershipFactory.build(team=other_team)]), added_at=datetime.datetime.now()) assert TabItem.query.count() == 1 response = client.delete( url_for('api.tab_items_delete', team_slug=other_team.slug, tab_item_id=tab_item.id)) assert response.status_code == 404 assert TabItem.query.count() == 1
def logged_in_user(self, team): return UserFactory(memberships=[ TeamMembershipFactory.build(team=team, is_admin=False) ])