Skip to content

Commit

Permalink
[#474] Create Test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Jan 2, 2025
1 parent 737bdd4 commit 407b61f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/objects/tests/admin/test_token_permissions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from django.urls import reverse_lazy

import requests_mock
Expand Down Expand Up @@ -63,3 +65,21 @@ def test_get_permission_with_unavailable_objecttypes(self, m):
response = self.app.get(self.url)

self.assertEqual(response.status_code, 200)


@disable_admin_mfa()
@requests_mock.Mocker()
class AdminVersionTests(WebTest):
url = reverse_lazy("admin:index")

def setUp(self):
user = UserFactory(is_superuser=True, is_staff=True)
self.app.set_user(user)

def test_version(self, m):
response = self.app.get(self.url)
self.assertEqual(response.status_code, 200)
if os.environ["ENVIRONMENT"] == "development":
self.assertEqual(os.environ["RELEASE"], "dev")
else:
self.assertEqual(os.environ["RELEASE"], "prod")

0 comments on commit 407b61f

Please sign in to comment.