def _makeCSVstr(object_list): table = Results.to_pretty_table(object_list) CSVstr = cStringIO.StringIO() writer = csv.writer(CSVstr) writer.writerows(table) CSVstr.seek(0) return CSVstr
def create_result(self): exp = Experiment() exp.date = datetime.now() exp.cycles = 0 exp.flows = 0 exp.unique = uuid.uuid1() exp.save() result = Results() result.resultsName = 'foo' result.experiment = exp result.processedCycles = 0 result.processedflows = 0 result.framesProcessed = 0 result.save() self.assertIsNotNone(result.id, 'Result id is None') return result