Я тестирую представления в приложении django.Между моделями (пользователями, отделами, отчетами и т. Д.) Существует множество отношений OneToMany и ManyToMany. Требуется много времени для заполнения определенных полей, таких как имя, фамилия, дата рождения и т. Д., При создании прибора, который я вообще не использую.Как я могу их игнорировать?Также, каковы лучшие практики при создании приспособления?Мои сиськи вот так
class TestReportModel(TestCase):
allow_database_queries = True
@classmethod
def setUpTestData(cls):
cls.report_id = 99
cls.factory = RequestFactory()
cls.user_with_access = User.objects.create(username="user1", password="password")
cls.employee = Employee.objects.create(user=cls.user_with_access, fio="name1 surname1",
date_of_birth="2012-12-12")
cls.indicator = Indicator.objects.create(context_id=10, set_id=10)
cls.ife = IndicatorsForEmployees.objects.create(employee=cls.employee, indicator=cls.indicator)
cls.report = Report.objects.create(owner=cls.ife)
cls.report.id = cls.report_id
cls.report.save()
cls.user_with_no_access = User.objects.create(username="user_with_no_access", password="password")
cls.employee_with_no_access = Employee.objects.create(user=cls.user_with_no_access, fio="name2 surname2",
date_of_birth="2018-12-12")