Add backref in InboundNumber model

This commit is contained in:
Ken Tsang
2017-08-04 12:13:10 +01:00
parent 4efb3238db
commit 3c392596a3
4 changed files with 42 additions and 25 deletions

View File

@@ -39,7 +39,7 @@ from app.dao.invited_user_dao import save_invited_user
from app.dao.provider_rates_dao import create_provider_rates
from app.clients.sms.firetext import FiretextClient
from tests import create_authorization_header
from tests.app.db import create_user, create_template, create_notification, create_api_key
from tests.app.db import create_user, create_template, create_notification, create_api_key, create_inbound_number
@pytest.yield_fixture
@@ -983,6 +983,15 @@ def sample_provider_rate(notify_db, notify_db_session, valid_from=None, rate=Non
)
@pytest.fixture
def sample_inbound_numbers(notify_db, notify_db_session, sample_service):
inbound_numbers = []
inbound_numbers.append(create_inbound_number(number='1', provider='mmg'))
inbound_numbers.append(create_inbound_number(number='2', provider='mmg', active=False))
inbound_numbers.append(create_inbound_number(number='3', provider='firetext', service_id=sample_service.id))
return inbound_numbers
@pytest.fixture
def restore_provider_details(notify_db, notify_db_session):
"""