chess_rpg_backend/common/tests.py

23 lines
565 B
Python
Raw Normal View History

2022-07-02 14:24:06 +03:00
from rest_framework.test import APITestCase
from django.urls import reverse
from rest_framework import status
class GetBasicTest(APITestCase):
def __init__(self, url):
super().__init__()
self._url = reverse(url)
@property
def url(self):
return self._url
@url.setter
def url(self, value):
self._url = reverse(value)
def test_accessibility(self):
"""Test if POST request is possible"""
response = self.client.post(self._url)
self.assertNotEqual(response, status.HTTP_404_NOT_FOUND)