From 98014204bc29b22b0ff9fb3c1b6dffa9adb08d82 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 28 Oct 2021 12:42:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Add=20`SophonInstanceDetailsTest?= =?UTF-8?q?Case`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sophon/core/tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/sophon/core/tests.py b/backend/sophon/core/tests.py index cff796d..5c4cd69 100644 --- a/backend/sophon/core/tests.py +++ b/backend/sophon/core/tests.py @@ -3,6 +3,7 @@ import contextlib import typing as t import django.urls.exceptions +import pkg_resources from django.contrib.auth.models import User from django.urls import reverse from rest_framework.response import Response @@ -527,6 +528,16 @@ class ResearchGroupTestCase(WriteSophonTestCase): # TODO: Test join and leave -# TODO: Test instance details + +class SophonInstanceDetailsTestCase(BetterAPITestCase): + def test_details_200(self): + response = self.client.get("/api/core/instance/") + self.assertEqual(response.status_code, 200) + self.assertData(response.data, { + "name": "Sophon", + "description": None, + "theme": "sophon", + "version": pkg_resources.get_distribution("sophon").version, + }) # TODO: Test some more code