Adding default values

This commit is contained in:
Martyn Inglis
2016-08-24 14:16:39 +01:00
parent 5adecda41e
commit 48089e21e5
2 changed files with 5 additions and 1 deletions

View File

@@ -361,7 +361,9 @@ class Job(db.Model):
index=True, index=True,
unique=False, unique=False,
nullable=True) nullable=True)
job_status = db.Column(db.String(255), db.ForeignKey('job_status.name'), index=True, nullable=True) job_status = db.Column(
db.String(255), db.ForeignKey('job_status.name'), index=True, nullable=True, default='pending'
)
VERIFY_CODE_TYPES = [EMAIL_TYPE, SMS_TYPE] VERIFY_CODE_TYPES = [EMAIL_TYPE, SMS_TYPE]

View File

@@ -111,6 +111,8 @@ def test_get_job_by_id(notify_api, sample_job):
def test_create_job(notify_api, sample_template, mocker, fake_uuid): def test_create_job(notify_api, sample_template, mocker, fake_uuid):
with notify_api.test_request_context(): with notify_api.test_request_context():
with notify_api.test_client() as client: with notify_api.test_client() as client:
from time import sleep
sleep(30)
mocker.patch('app.celery.tasks.process_job.apply_async') mocker.patch('app.celery.tasks.process_job.apply_async')
data = { data = {
'id': fake_uuid, 'id': fake_uuid,