def test_retrieve_cached_file_generation_not_cached(database): """ Should return no FileGeneration """ sess = database.session job = JobFactory(start_date='2017-01-01', end_date='2017-01-31', job_status_id=JOB_STATUS_DICT['waiting'], error_message=None, file_type_id=FILE_TYPE_DICT['award'], job_type_id=JOB_TYPE_DICT['file_upload'], filename=None, original_filename=None, file_generation_id=None) file_gen = FileGenerationFactory(request_date=datetime.now().date(), start_date='2017-01-01', end_date='2017-01-31', file_type='D2', agency_code='123', agency_type='awarding', is_cached_file=False, file_format='csv') sess.add_all([job, file_gen]) sess.commit() file_generation = retrieve_cached_file_generation(job, 'awarding', '123', 'csv') assert file_generation is None
def test_retrieve_cached_file_generation_none(database): """ Should return no FileGeneration """ sess = database.session job = JobFactory( start_date='2017-01-01', end_date='2017-01-31', job_status_id=JOB_STATUS_DICT['waiting'], error_message=None, file_type_id=FILE_TYPE_DICT['award'], job_type_id=JOB_TYPE_DICT['file_upload'], filename=None, original_filename=None, file_generation_id=None) sess.add(job) sess.commit() file_generation = retrieve_cached_file_generation(job, 'awarding', '123') assert file_generation is None
def test_retrieve_cached_file_generation_not_cached(database): """ Should return no FileGeneration """ sess = database.session job = JobFactory( start_date='2017-01-01', end_date='2017-01-31', job_status_id=JOB_STATUS_DICT['waiting'], error_message=None, file_type_id=FILE_TYPE_DICT['award'], job_type_id=JOB_TYPE_DICT['file_upload'], filename=None, original_filename=None, file_generation_id=None) file_gen = FileGenerationFactory( request_date=datetime.now().date(), start_date='2017-01-01', end_date='2017-01-31', file_type='D2', agency_code='123', agency_type='awarding', is_cached_file=False) sess.add_all([job, file_gen]) sess.commit() file_generation = retrieve_cached_file_generation(job, 'awarding', '123') assert file_generation is None
def test_retrieve_cached_file_generation_none(database): """ Should return no FileGeneration """ sess = database.session job = JobFactory(start_date='2017-01-01', end_date='2017-01-31', job_status_id=JOB_STATUS_DICT['waiting'], error_message=None, file_type_id=FILE_TYPE_DICT['award'], job_type_id=JOB_TYPE_DICT['file_upload'], filename=None, original_filename=None, file_generation_id=None) sess.add(job) sess.commit() file_generation = retrieve_cached_file_generation(job, 'awarding', '123') assert file_generation is None