Exemplo n.º 1
0
    def test_build_cleaner(self):
        cleaner = tasks._build_cleaner(self.org)

        # data is cleaned correctly for fields on BuildingSnapshot
        # model
        bs_field = "gross_floor_area"
        self.assertEqual(cleaner.clean_value("123,456", bs_field), 123456)

        # data is cleaned correctly for mapped fields that have unit
        # type information
        self.assertEqual(cleaner.clean_value("123,456", self.mapped_col), 123456)

        # other fields are just strings
        self.assertEqual(cleaner.clean_value("123,456", "random"), "123,456")
Exemplo n.º 2
0
    def test_build_cleaner(self):
        cleaner = tasks._build_cleaner(self.org)

        # data is cleaned correctly for fields on BuildingSnapshot
        # model
        bs_field = 'gross_floor_area'
        self.assertEqual(cleaner.clean_value('123,456', bs_field), 123456)

        # data is cleaned correctly for mapped fields that have unit
        # type information
        self.assertEqual(cleaner.clean_value('123,456', self.mapped_col),
                         123456)

        # other fields are just strings
        self.assertEqual(cleaner.clean_value('123,456', 'random'), '123,456')