From f73f9836b3bc56fe1068fb4b889c82766c5330f3 Mon Sep 17 00:00:00 2001 From: Daniel Gray Date: Thu, 13 Jun 2024 12:28:58 +0200 Subject: [PATCH] updated tests --- app/general/tests/test_dev_mass_upload.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/general/tests/test_dev_mass_upload.py b/app/general/tests/test_dev_mass_upload.py index 3a0a8055..85c7bbe0 100644 --- a/app/general/tests/test_dev_mass_upload.py +++ b/app/general/tests/test_dev_mass_upload.py @@ -1,4 +1,5 @@ import os +import random import unittest from unittest.mock import MagicMock @@ -44,12 +45,15 @@ def test_check_file_type_pdf(self): def test_save_data(self): self.command = Command() # Create some Institutions instances for testing - for _ in range(20): + for i in range(1, 30): + random_number = random.randint(1, 1000) + Institution.objects.create( - name=self.fake.company(), - abbreviation=self.fake.company_suffix(), - url=self.fake.url(), - email=self.fake.company_email(), + id=i, + name=str(random_number) + "_" + self.fake.company(), + abbreviation=str(random_number) + "_" + self.fake.company_suffix(), + url=str(random_number) + "_" + self.fake.url(), + email=str(random_number) + "_" + self.fake.company_email(), logo="", )