Updated test suites

This commit is contained in:
Ceferino Patino 2024-02-16 21:32:48 -06:00
commit a39e51e1f5
8 changed files with 46 additions and 59 deletions

View file

@ -5,11 +5,9 @@ from housewars.utils import get_random_string
class GetRandomStringTest(TestCase):
def test_string_of_length_8(self):
"""The string generated is of the correct length"""
string = get_random_string(8)
self.assertEqual(len(string), 8)
def test_string_of_length_6(self):
"""The string generated is of the correct length"""
string = get_random_string(6)
self.assertEqual(len(string), 6)

View file

@ -14,7 +14,6 @@ class UnpackValuesTest(TestCase):
self.test_queryset = House.objects.all()
def test_matching_object_instance(self):
"""Correctly unpacks the headers into the first index"""
headers = [field.name for field in House._meta.fields]
self.assertIsInstance(

View file

@ -12,7 +12,6 @@ class UnpackValuesTest(TestCase):
self.test_queryset = House.objects.all()
def test_valid_row_headers(self):
"""Correctly unpacks the headers into the first index"""
headers = [field.name for field in House._meta.fields]
values = unpack_values(self.test_queryset, headers)
@ -20,7 +19,6 @@ class UnpackValuesTest(TestCase):
values[0], headers)
def test_complete_values(self):
"""Maintains the complete queryset and returns it"""
headers = [field.name for field in House._meta.fields]
values = unpack_values(self.test_queryset, headers)
queryset = list(self.test_queryset.values_list())

View file

@ -60,9 +60,3 @@ class UserEntryCreateViewTest(TestCase):
self.client.post(self.url, data)
self.assertEquals(self.house.userentry_set.count(), 0)
def test_empty_POST(self):
response = self.client.post(self.url)
self.assertEquals(response.status_code, 400)
self.assertEquals(self.house.pointsentry_set.count(), 0)