aboutsummaryrefslogtreecommitdiff
path: root/patchwork/tests/api/test_patch.py
diff options
context:
space:
mode:
Diffstat (limited to 'patchwork/tests/api/test_patch.py')
-rw-r--r--patchwork/tests/api/test_patch.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/patchwork/tests/api/test_patch.py b/patchwork/tests/api/test_patch.py
index ef418e2..888a257 100644
--- a/patchwork/tests/api/test_patch.py
+++ b/patchwork/tests/api/test_patch.py
@@ -14,8 +14,10 @@ from patchwork.models import Patch
from patchwork.tests.api import utils
from patchwork.tests.utils import create_maintainer
from patchwork.tests.utils import create_patch
+from patchwork.tests.utils import create_patches
from patchwork.tests.utils import create_person
from patchwork.tests.utils import create_project
+from patchwork.tests.utils import create_series
from patchwork.tests.utils import create_state
from patchwork.tests.utils import create_user
@@ -208,6 +210,15 @@ class TestPatchAPI(utils.APITestCase):
self.assertIn('url', resp.data[0])
self.assertNotIn('web_url', resp.data[0])
+ def test_list_bug_335(self):
+ """Ensure we retrieve the embedded series project once."""
+ series = create_series()
+ create_patches(5, series=series)
+
+ # FIXME(stephenfin): This should result in 3 queries
+ with self.assertNumQueries(8):
+ self.client.get(self.api_url())
+
@utils.store_samples('patch-detail')
def test_detail(self):
"""Show a specific patch."""