21 lines
652 B
Python
21 lines
652 B
Python
from django.test import TestCase
|
|
from GeoffreyApp.api.commands import *
|
|
from GeoffreyApp.models import *
|
|
# Create your tests here.
|
|
|
|
MC_UUID = "fe7e84132570458892032b69ff188bc3"
|
|
DISCORD_UUID = "143072699567177728"
|
|
USERNAME = "ZeroHD"
|
|
|
|
|
|
class CommandsAPITestCase(TestCase):
|
|
def setUp(self):
|
|
Player.objects.create(name=USERNAME, mc_uuid=MC_UUID, discord_uuid=DISCORD_UUID)
|
|
|
|
def test_register(self):
|
|
command_dict["POST"]["register"]["func"](player_name="Vakky", discord_uuid="229423434256351233")
|
|
|
|
count = Player.objects.filter(mc_uuid__iexact="7afbf6632bf049ef915f22e81b298d17").count()
|
|
|
|
self.assertEqual(count, 1)
|