def test_audit_required_subjects(self): self.assertFalse(self.qa.audit_required_subjects()) self.requirement.require_certain_subjects = True self.requirement.save() self.subject1 = ( ModelFactories.get_qualification_entrance_requirement_to()) self.subject1.qualification = self.qualification self.subject1.save() self.assertTrue(self.qa.audit_required_subjects())
def test_save_qualification_runs_audit(self): self.assertFalse(self.qualification.ready_to_publish) self.requirement.require_certain_subjects = True self.requirement.save() self.subject1 = ( ModelFactories.get_qualification_entrance_requirement_to()) self.subject1.qualification = self.qualification self.subject1.save() self.qualification.short_description = "Something" self.qualification.save() self.assertTrue(self.qualification.ready_to_publish)
def setUp(self): self.campus = ModelFactories.get_campus_test_object() self.provider = self.campus.provider self.requirement_subject = ModelFactories.get_qualification_entrance_requirement_to( ) # noqa self.qualification = self.requirement_subject.qualification self.qualification.campus = self.campus self.qualification.provider = self.provider self.qualification.save() output_data = providerView.excel_dump(self.provider.id) named_tempfile = NamedTemporaryFile(suffix='.xlsx') with open(named_tempfile.name, 'wb') as file: file.write(output_data) excel = SmartExcel( definition=OPENEDU_EXCEL_DEFINITION, data=OpenEduSmartExcelData(provider_id=self.provider.id), path=named_tempfile.name) # provider.dump(None, provider.id) self.data = excel.parse()