mirror of
https://github.com/evgen-app/chess_rpg_backend.git
synced 2024-11-22 09:37:05 +03:00
added instructions, inited tests
This commit is contained in:
parent
52a8608198
commit
d26dbee256
11
README.md
11
README.md
|
@ -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
22
common/tests.py
Normal 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)
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
Loading…
Reference in New Issue
Block a user