added instructions, inited tests

This commit is contained in:
Alexander Karpov 2022-06-21 11:37:18 +03:00
parent 52a8608198
commit d26dbee256
3 changed files with 33 additions and 3 deletions

View File

@ -1,2 +1,13 @@
# chess_rpg_backend
Backend for chess rpg game
### installation
```shell
$ python3 manage.py makemigrations & python3 manage.py migrate
$ docker run -p 6379:6379 -d redis:5
```
### run
```shell
$ python3 manage.py runserver 0.0.0.0:8000
```

22
common/tests.py Normal file
View File

@ -0,0 +1,22 @@
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)

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.