mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 02:49:42 -04:00
Merge pull request #405 from alphagov/dashboard-slowdown
exclude notifications from job
This commit is contained in:
@@ -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
10
tests/app/test_schemas.py
Normal 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
|
||||
Reference in New Issue
Block a user