From 14faaad7dcfbd15757229a696fddf9eb1a0129fa Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 28 Oct 2021 09:49:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=94=20Add=20todos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sophon/core/tests.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/sophon/core/tests.py b/backend/sophon/core/tests.py index a45fc33..cff796d 100644 --- a/backend/sophon/core/tests.py +++ b/backend/sophon/core/tests.py @@ -57,18 +57,18 @@ class ReadSophonTestCase(BetterAPITestCase, metaclass=abc.ABCMeta): raise NotImplementedError() @classmethod - def get_url(cls, action: str, *args, **kwargs) -> str: + def get_url(cls, kind: str, *args, **kwargs) -> str: """ Find the URL of a specific action by using :func:`django.urls.reverse`. - :param action: The action to perform on the ViewSet, such as `"list"` or `"destroy"`. + :param kind: The kind of view of the ViewSet to access: either ``"list"`` or ``"detail"``. :param args: Positional arguments passed to :func:`django.urls.reverse` for getting the URL. :param kwargs: Keyword arguments passed to :func:`django.urls.reverse` for getting the URL. :return: The URL corresponding to the action with all parameters filled in. """ basename = cls.get_basename() try: - return reverse(f"{basename}-{action}", args=args, kwargs=kwargs) + return reverse(f"{basename}-{kind}", args=args, kwargs=kwargs) except django.urls.exceptions.NoReverseMatch: raise errors.HTTPException(404) @@ -524,3 +524,9 @@ class ResearchGroupTestCase(WriteSophonTestCase): def test_destroy_403(self): with self.as_user(self.outside_user.username): self.assertActionDestroy("alpha", 403) + + # TODO: Test join and leave + +# TODO: Test instance details + +# TODO: Test some more code