Skip to content

Commit 07f655b

Browse files
authored
Merge pull request #118 from magfest/chore/tests-clean-up
Chore/tests clean up
2 parents b2fdcf2 + 69dc2ae commit 07f655b

5 files changed

Lines changed: 1 addition & 112 deletions

File tree

tests/integration/test_admin_features.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -68,41 +68,6 @@ def _seed_admin(app):
6868
class TestQuickBooksClassFields:
6969
"""Tests for qb_class field persistence on org models."""
7070

71-
def test_event_cycle_qb_class_persists(self, app, db_session):
72-
"""qb_class should be saved and loaded on EventCycle."""
73-
_seed_admin(app)
74-
75-
cycle = EventCycle.query.filter_by(code="TST2026").one()
76-
assert cycle.qb_class is None
77-
78-
cycle.qb_class = "Super_MAGFest"
79-
db_session.commit()
80-
81-
reloaded = EventCycle.query.filter_by(code="TST2026").one()
82-
assert reloaded.qb_class == "Super_MAGFest"
83-
84-
def test_division_qb_class_persists(self, app, db_session):
85-
"""qb_class should be saved and loaded on Division."""
86-
_seed_admin(app)
87-
88-
div = Division.query.filter_by(code="TESTDIV").one()
89-
div.qb_class = "Gaming"
90-
db_session.commit()
91-
92-
reloaded = Division.query.filter_by(code="TESTDIV").one()
93-
assert reloaded.qb_class == "Gaming"
94-
95-
def test_department_qb_class_persists(self, app, db_session):
96-
"""qb_class should be saved and loaded on Department."""
97-
_seed_admin(app)
98-
99-
dept = Department.query.filter_by(code="TESTDEPT").one()
100-
dept.qb_class = "Staff Services"
101-
db_session.commit()
102-
103-
reloaded = Department.query.filter_by(code="TESTDEPT").one()
104-
assert reloaded.qb_class == "Staff Services"
105-
10671
def test_multiple_entities_share_qb_class(self, app, db_session):
10772
"""Multiple entities should be able to share the same qb_class value."""
10873
_seed_admin(app)
@@ -131,17 +96,6 @@ def test_defaults_to_false(self, app, db_session):
13196
cycle = EventCycle.query.filter_by(code="TST2026").one()
13297
assert cycle.dates_are_public is False
13398

134-
def test_toggle_persists(self, app, db_session):
135-
"""dates_are_public should be toggleable and persist."""
136-
_seed_admin(app)
137-
138-
cycle = EventCycle.query.filter_by(code="TST2026").one()
139-
cycle.dates_are_public = True
140-
db_session.commit()
141-
142-
reloaded = EventCycle.query.filter_by(code="TST2026").one()
143-
assert reloaded.dates_are_public is True
144-
14599
def test_dates_still_stored_when_not_public(self, app, db_session):
146100
"""Event dates should be stored regardless of visibility setting."""
147101
_seed_admin(app)

tests/integration/test_admin_line_tools.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -530,31 +530,11 @@ def test_detail_page_shows_add_line_for_admin(self, app, client, seed_draft_work
530530
assert resp.status_code == 200
531531
assert b"add-line" in resp.data
532532

533-
def test_approvals_line_review_shows_edit_link_for_admin(self, app, client, seed_draft_work_item):
534-
# Admins do their reviewing from the approvals-side line page
535-
# (budget/line_review.html), so the edit link must appear there too.
536-
data = seed_draft_work_item
537-
_make_submitted(data)
538-
_login(client, "test:admin")
539-
540-
resp = client.get(_url(app, "approvals.line_review", data, line_num=1))
541-
assert resp.status_code == 200
542-
assert b"change-account" in resp.data
543-
544-
545533
class TestPriceSnapshotColumn:
546534
def test_column_defaults_to_none(self, app, seed_draft_work_item):
547535
data = seed_draft_work_item
548536
assert data["detail"].account_default_unit_price_cents is None
549537

550-
def test_column_round_trips(self, app, seed_draft_work_item):
551-
data = seed_draft_work_item
552-
data["detail"].account_default_unit_price_cents = 15900
553-
db.session.commit()
554-
db.session.refresh(data["detail"])
555-
assert data["detail"].account_default_unit_price_cents == 15900
556-
557-
558538
class TestAdminAccountList:
559539
def test_includes_fixed_hotel_and_badge_excludes_inactive(
560540
self, app, seed_draft_work_item

tests/integration/test_board_release_scope.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
from app.models import WorkType, WorkTypeConfig
99

1010

11-
def test_budget_opts_into_board_release(app, seed_workflow_data):
12-
config = (
13-
WorkTypeConfig.query
14-
.filter_by(url_slug="budget")
15-
.first()
16-
)
17-
assert config is not None
18-
assert config.uses_board_release is True
19-
20-
2111
def test_non_budget_work_type_defaults_to_no_board_release(app, seed_workflow_data):
2212
"""Guard the column default, not just BUDGET's seeded override.
2313

tests/integration/test_route_migration.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ def test_legacy_budget_portfolio_url_resolves(self, app, client, seed_workflow_d
9393
f"the route may have been broken during migration."
9494
)
9595

96-
def test_new_slug_url_resolves_for_budget(self, app, client, seed_workflow_data):
97-
"""Same URL via the new <work_type_slug> rule reaches the same handler."""
98-
cycle = seed_workflow_data["cycle"]
99-
dept = seed_workflow_data["department"]
100-
_login(client, "test:admin")
101-
102-
# The URL string is identical to the legacy one — Flask picks the
103-
# literal "budget" rule due to specificity preference. This proves
104-
# the legacy URL still maps cleanly even with both rules registered.
105-
response = client.get(f"/{cycle.code}/{dept.code}/budget")
106-
assert response.status_code == 200
107-
108-
10996
class TestNonBudgetSlugBehavior:
11097
"""Non-budget slugs reach the right handlers with the right behavior."""
11198

tests/unit/test_email_outbox_models.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Model-level tests for the email outbox tables."""
22
from datetime import datetime
33

4-
from app.models import EmailMessageBody, EmailOutbox, EmailSuppression, NotificationLog
4+
from app.models import EmailOutbox, EmailSuppression
55
from app.models.constants import OUTBOX_CLAIMABLE_STATUSES, OUTBOX_STATUS_QUEUED
66
from app import db
77

@@ -38,28 +38,6 @@ def test_dedup_key_is_unique(app):
3838
db.session.rollback()
3939

4040

41-
def test_message_body_links_to_its_log_row(app):
42-
"""Do NOT assert ON DELETE CASCADE here.
43-
44-
SQLite defaults PRAGMA foreign_keys to OFF and this app registers no
45-
connect listener to turn it on, so no ondelete clause fires in dev or
46-
test. The CASCADE is declared for Postgres; Task 13's prune deletes
47-
bodies explicitly so retention does not depend on it.
48-
"""
49-
with app.app_context():
50-
log = NotificationLog(
51-
template_key="submitted", recipient_email="c@example.org", status="SENT",
52-
)
53-
db.session.add(log)
54-
db.session.commit()
55-
db.session.add(EmailMessageBody(
56-
notification_log_id=log.id, subject="s", body_text="t", body_html="<p>t</p>",
57-
))
58-
db.session.commit()
59-
body = db.session.query(EmailMessageBody).one()
60-
assert body.notification_log_id == log.id
61-
62-
6341
def test_the_status_default_is_a_claimable_status():
6442
"""A new row must land in a status the drainer will pick up.
6543

0 commit comments

Comments
 (0)