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

@@ -1,23 +0,0 @@
from app import db
from app.dao.dao_utils import transactional
from app.models import LetterRate
@transactional
def dao_create_letter_rate(letter_rate):
db.session.add(letter_rate)
def get_letter_rates_for_daterange(date, crown, sheet_count, post_class='second'):
rates = LetterRate.query.filter(
LetterRate.start_date <= date
).filter((LetterRate.end_date == None) | # noqa
(LetterRate.end_date > date)
).filter(
LetterRate.crown == crown
).filter(
LetterRate.sheet_count == sheet_count
).filter(
LetterRate.post_class == post_class
).all()
return rates