def test_prepare_row(self, get_schema_mock): """ Test if whole row is properly prepared for placing it in report """ data = {'field1': 123, 'field2': D('3'), 'field3': 3123, 'field4': 33} get_schema_mock.return_value = utils.sample_schema() result = BasePluginReport._prepare_row(data) self.assertEquals(result, [123, '3.00', 3123, '33.00', '36.00'])
def test_get_header(self, get_schema_mock): """ Test getting headers for report """ get_schema_mock.return_value = utils.sample_schema() result = AllVentures.get_header() self.assertEquals(result, [[ 'Field1', 'Field2 - PLN', 'Field3', 'Field4 - PLN', 'Total cost' ]])
def test_prepare_row(self, get_schema_mock): """ Test if whole row is properly prepared for placing it in report """ data = { 'field1': 123, 'field2': D('3'), 'field3': 3123, 'field4': 33 } get_schema_mock.return_value = utils.sample_schema() result = BasePluginReport._prepare_row(data) self.assertEquals( result, [123, '3.00', 3123, '33.00', '36.00'] )