def test_save_method(self): rs = ReportStorage() rs.dirPath = self.tempdir rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() rs = ReportStorage() rs.dirPath = self.tempdir2 rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() for rs in ReportStorage.objects.exclude(id=rs.id): self.assertFalse(rs.default, 'Should not be default report storage location, only one default location is allowed')
def test_save(self): rs = ReportStorage() rs.dirPath = self.tempdir rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() self.assertIsNotNone(rs.id, 'ReportStorage id is None') return rs
def setUp(self): self.tempdir = tempfile.mkdtemp() rs = ReportStorage() rs.dirPath = self.tempdir rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() self.reportstorage = rs
def test_save_method(self): rs = ReportStorage() rs.dirPath = self.tempdir rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() rs = ReportStorage() rs.dirPath = self.tempdir2 rs.default = True rs.name = 'HomeTest' rs.webServerPath = '/outputTest' rs.save() for rs in ReportStorage.objects.exclude(id=rs.id): self.assertFalse( rs.default, 'Should not be default report storage location, only one default location is allowed' )