def setUpTestData(cls): cls.project = ProjectFactory() cls.report = ReportFactory(project=cls.project) cls.user = UserFactory(password=PASSWORD) cls.uri = reverse("reporting:report_create_no_project") cls.project_uri = reverse( "reporting:report_create", kwargs={"pk": cls.project.pk} )
def setUpTestData(cls): cls.unavailable_status = DomainStatusFactory(domain_status="Unavailable") cls.domain = DomainFactory(expiration=date.today() + timedelta(days=360)) cls.unavailable_domain = DomainFactory( domain_status=cls.unavailable_status, expiration=date.today() + timedelta(days=360), ) cls.expired_domain = DomainFactory(expiration=date.today() - timedelta(days=30)) cls.project = ProjectFactory()
def setUpTestData(cls): cls.project = ProjectFactory() cls.project_dict = cls.project.__dict__ cls.objective_1 = ProjectObjectiveFactory( project=cls.project, deadline=cls.project.end_date ) cls.objective_2 = ProjectObjectiveFactory( project=cls.project, deadline=cls.project.end_date ) cls.to_be_deleted = ProjectObjectiveFactory(project=cls.project)
def setUpTestData(cls): cls.project = ProjectFactory() cls.domain = HistoryFactory(project=cls.project) cls.server = ServerHistoryFactory(project=cls.project) cls.vps = TransientServerFactory(project=cls.project) cls.link = DomainServerConnectionFactory( project=cls.project, domain=cls.domain, static_server=cls.server, transient_server=None, ) cls.link_dict = cls.link.__dict__
def setUpTestData(cls): cls.group_1 = GroupFactory(name="Group 1") cls.group_2 = GroupFactory(name="Group 2") cls.user = UserFactory(password=PASSWORD, groups=(cls.group_1, )) cls.project = ProjectFactory() cls.report = ReportFactory(project=cls.project) cls.num_of_findings = 3 ReportFindingLinkFactory.create_batch(cls.num_of_findings, report=cls.report, assigned_to=cls.user) cls.uri = reverse("home:dashboard")
def setUpTestData(cls): cls.ProjectObjective = ProjectObjectiveFactory._meta.model cls.project = ProjectFactory() for x in range(3): ProjectObjectiveFactory(project=cls.project) cls.server = StaticServerFactory() cls.aux_address_1 = AuxServerAddressFactory( static_server=cls.server, ip_address="1.1.1.1", primary=True ) cls.aux_address_2 = AuxServerAddressFactory( static_server=cls.server, ip_address="1.1.1.2", primary=False ) cls.scope = ProjectScopeFactory( project=cls.project, scope="1.1.1.1\r\n1.1.1.2\r\n1.1.1.3\r\n1.1.1.4\r\n1.1.1.5", )
def test_checkout_adjustment_signal(self): yesterday = date.today() - timedelta(days=1) project = ProjectFactory( start_date=date.today() - timedelta(days=14), end_date=date.today() + timedelta(days=14), ) domain_checkout = HistoryFactory(start_date=project.start_date, end_date=project.end_date, project=project) exp_domain_checkout = HistoryFactory(start_date=project.start_date, end_date=yesterday, project=project) server_checkout = ServerHistoryFactory(start_date=project.start_date, end_date=project.end_date, project=project) exp_server_checkout = ServerHistoryFactory( start_date=project.start_date, end_date=yesterday, project=project) new_start = project.start_date - timedelta(days=7) new_end = project.end_date + timedelta(days=7) project.start_date = new_start project.end_date = new_end project.save() domain_checkout.refresh_from_db() exp_domain_checkout.refresh_from_db() server_checkout.refresh_from_db() exp_server_checkout.refresh_from_db() self.assertEqual(domain_checkout.start_date, new_start) self.assertEqual(server_checkout.start_date, new_start) self.assertEqual(domain_checkout.end_date, new_end) self.assertEqual(server_checkout.end_date, new_end) self.assertEqual(exp_domain_checkout.end_date, yesterday) self.assertEqual(exp_server_checkout.end_date, yesterday)
def setUpTestData(cls): cls.project = ProjectFactory(complete=False) cls.user = UserFactory(password=PASSWORD) cls.uri = reverse("rolodex:ajax_toggle_project", kwargs={"pk": cls.project.pk})
def test_prop_count_findings(self): project = ProjectFactory() report = ReportFactory(project=project) for x in range(3): ReportFindingLinkFactory(report=report) self.assertEqual(project.count_findings(), 3)
def test_get_absolute_url(self): project = ProjectFactory() try: project.get_absolute_url() except: self.fail("Project.get_absolute_url() raised an exception")
def setUpTestData(cls): cls.project = ProjectFactory() cls.project_dict = cls.project.__dict__ cls.target_1 = ProjectTargetFactory(project=cls.project) cls.target_2 = ProjectTargetFactory(project=cls.project) cls.to_be_deleted = ProjectTargetFactory(project=cls.project)
def setUpTestData(cls): cls.project = ProjectFactory() cls.project_dict = cls.project.__dict__ cls.scope_1 = ProjectScopeFactory(project=cls.project) cls.scope_2 = ProjectScopeFactory(project=cls.project) cls.to_be_deleted = ProjectScopeFactory(project=cls.project)
def setUpTestData(cls): cls.project = ProjectFactory() cls.project_dict = cls.project.__dict__
def setUpTestData(cls): cls.project = ProjectFactory() cls.server = TransientServerFactory(project=cls.project) cls.server_dict = cls.server.__dict__
def setUpTestData(cls): cls.unavailable_status = ServerStatusFactory(server_status="Unavailable") cls.server = StaticServerFactory() cls.unavailable_server = StaticServerFactory(server_status=cls.unavailable_status) cls.project = ProjectFactory()
def setUpTestData(cls): cls.project = ProjectFactory() cls.report = ReportFactory(project=cls.project) cls.report_dict = cls.report.__dict__
def setUpTestData(cls): cls.project = ProjectFactory(complete=False) cls.user = UserFactory(password=PASSWORD) cls.uri = reverse("oplog:oplog_create_no_project") cls.project_uri = reverse("oplog:oplog_create", kwargs={"pk": cls.project.pk})
def test_valid_data(self): project = ProjectFactory() oplog = OplogFactory.build(project=project) form = self.form_data(**oplog.__dict__) self.assertTrue(form.is_valid())