Merge pull request #405 from alphagov/dashboard-slowdown

exclude notifications from job
This commit is contained in:
Leo Hemsted
2016-06-10 16:45:05 +01:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -160,6 +160,7 @@ class JobSchema(BaseSchema):
class Meta:
model = models.Job
exclude = ('notifications',)
class RequestVerifyCodeSchema(ma.Schema):

10
tests/app/test_schemas.py Normal file
View File

@@ -0,0 +1,10 @@
def test_job_schema_doesnt_return_notifications(sample_notification):
from app.schemas import job_schema
job = sample_notification.job
assert job.notifications.count() == 1
data, errors = job_schema.dump(job)
assert not errors
assert 'notifications' not in data