mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user