diff --git a/payapp/tests.py b/payapp/tests.py index 002c2ff..ae253ca 100644 --- a/payapp/tests.py +++ b/payapp/tests.py @@ -6,22 +6,14 @@ from timestamp_server import thrift_server class PayAppViewTests(TestCase): - @classmethod - def setUpClass(cls): - super().setUpClass() - # Start the Thrift server in a separate thread - cls.thrift_server_thread = Thread(target=thrift_server.start_thrift_server) - cls.thrift_server_thread.daemon = True - cls.thrift_server_thread.start() - @classmethod def tearDownClass(cls): super().tearDownClass() # Stop the Thrift server thrift_server.stop_thrift_server() + print('Thrift server stopped.') def setUp(self): - super().setUp() self.client = Client() # Create a user and an admin user self.user = User.objects.create_user(username='user', password='userpassword') diff --git a/register/tests.py b/register/tests.py index 1db0084..f963b47 100644 --- a/register/tests.py +++ b/register/tests.py @@ -1,6 +1,6 @@ from threading import Thread from unittest.mock import patch -from django.test import TestCase +from django.test import TestCase, Client from django.urls import reverse from django.contrib.auth.models import User, Group from register.forms import UserForm, LoginForm @@ -10,23 +10,15 @@ class UserViewTests(TestCase): - @classmethod - def setUpClass(cls): - super().setUpClass() - # Start the Thrift server in a separate thread - cls.thrift_server_thread = Thread(target=thrift_server.start_thrift_server) - cls.thrift_server_thread.daemon = True - cls.thrift_server_thread.start() - @classmethod def tearDownClass(cls): super().tearDownClass() # Stop the Thrift server thrift_server.stop_thrift_server() + print('Thrift server stopped.') def setUp(self): - super().setUp() - # Setup code for the tests, like creating a user or a group if needed + self.client = Client() # self.admin_group = Group.objects.create(name='AdminGroup') User.objects.create_user(username='testuser1',first_name='Test',last_name='User' ,password='testpassword123', email='test@example.com')