Use real letter_rates in tests

Added the letter_rate table to the list of tables which does not get
deleted after each test run and changed the tests to use the real letter
rates.

Also removed the letter rate DAO since this was only being used in
tests, so was no longer needed.
This commit is contained in:
Katie Smith
2018-07-10 11:31:18 +01:00
parent 8f211e00f5
commit c57f33a02d
9 changed files with 18 additions and 132 deletions

View File

@@ -32,7 +32,6 @@ from app.models import (
SMS_TYPE,
KEY_TYPE_NORMAL,
AnnualBilling,
LetterRate,
InvitedOrganisationUser,
FactBilling,
FactNotificationStatus,
@@ -475,28 +474,6 @@ def create_annual_billing(
return annual_billing
def create_letter_rate(
start_date=datetime(2017, 1, 1, 00, 00, 00),
end_date=None,
sheet_count=1,
rate=0.31,
crown=True,
post_class='second'
):
rate = LetterRate(
start_date=start_date,
end_date=end_date,
sheet_count=sheet_count,
rate=rate,
crown=crown,
post_class=post_class
)
db.session.add(rate)
db.session.commit()
return rate
def create_organisation(name='test_org_1', active=True):
data = {
'name': name,