Compare commits

...

6 Commits

Author SHA1 Message Date
8251fecf9a Merge pull request 'unit-testing' (#19) from calm-steam/GameServerSupervisor:unit-testing into master
Reviewed-on: #19
Reviewed-by: Pratyush Desai <pratyush.desai@liberta.casa>
2025-02-18 19:07:37 +01:00
07c1a2d8d6
fix readme 2025-02-16 16:06:06 +05:30
9f82e689a1
modify readme 2025-02-16 16:05:58 +05:30
9cec170f62
add webpanel/test_models.py as example 2025-02-16 16:05:47 +05:30
98b9574c67
delete webpanel/tests.py 2025-02-16 16:05:31 +05:30
7dc24f1456
remove docker reference in readme 2025-02-16 16:04:51 +05:30
3 changed files with 45 additions and 12 deletions

View File

@ -1,5 +1,12 @@
# GibCasa GameServerSupervisor
## Table of Contents
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
## Prerequisites
Python 3.10 or above
@ -22,19 +29,37 @@ Python 3.10 or above
```bash
pip install -r requirements.txt
```
5. Run migrations:
5. Run tests:
```bash
python manage.py migrate
./manage.py test
```
6. Create admin user:
6. Run migrations:
```bash
python manage.py createsuperuser
./manage.py migrate
```
7. Run server:
7. Create admin user:
```bash
python manage.py runserver
./manage.py createsuperuser
```
8. Run server:
```bash
./manage.py runserver
```
* visit http://localhost:8000 for /public and
http://localhost:8000/admin/ to login via the superuser credentials
* will need docker running
## Usage
* Visit http://localhost:8000 for /public and
http://localhost:8000/admin/ to login via the superuser credentials
## Contributing
1. Fork the repository.
2. Create a new branch: `git checkout -b feature-name`.
3. Make your changes.
4. Push your branch: `git push origin feature-name`.
5. Create a pull request.
## License
This project is licensed under the [AGPL](https://www.gnu.org/licenses/agpl-3.0.html).

11
webpanel/test_models.py Normal file
View File

@ -0,0 +1,11 @@
from django.test import TestCase
from webpanel.models import Game
class GameTestCase(TestCase):
def setUp(self):
Game.objects.create(name="Assassin's Creed")
def test_game_creation(self):
assassins = Game.objects.get(name="Assassin's Creed")
assert str(assassins) == "Assassin's Creed"

View File

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