mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
Fixing up tests to validate the call to the celery tasks.
- mocker used to test call or otherwise of the task - no new tests just a spring clean
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
from flask import jsonify
|
||||
|
||||
from app.models import (User, Service, Template, ApiKey, Job, VerifyCode, Notification)
|
||||
from app.models import (User, Service, Template, ApiKey, Job, Notification)
|
||||
from app.dao.users_dao import (save_model_user, create_user_code, create_secret_code)
|
||||
from app.dao.services_dao import save_model_service
|
||||
from app.dao.templates_dao import save_model_template
|
||||
@@ -10,6 +9,17 @@ from app.dao.jobs_dao import save_job
|
||||
from app.dao.notifications_dao import save_notification
|
||||
import uuid
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def service_factory(notify_db, notify_db_session):
|
||||
class ServiceFactory(object):
|
||||
def get(self, service_name):
|
||||
user = sample_user(notify_db, notify_db_session)
|
||||
service = sample_service(notify_db, notify_db_session, service_name, user)
|
||||
sample_template(notify_db, notify_db_session, service=service)
|
||||
return service
|
||||
|
||||
return ServiceFactory()
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_user(notify_db,
|
||||
|
||||
Reference in New Issue
Block a user