Exemplo n.º 1
0
    def test_discover_data_types_of_the_datarecords(self):
        entity = Entity(geocode="1234", geoname="Gulu", unique_name="Ashianti CHPS")
        entity.save()

        data_record = entity.submit_datarecord(
            record_dict={"name": "arv", "value": "12", "type": "int"}, reported_at=datetime.date(2011, 03, 01)
        )
        data_record.save()
        data_record = entity.submit_datarecord(
            record_dict={"name": "patients", "value": "1", "type": "int"}, reported_at=datetime.date(2011, 03, 03)
        )
        data_record.save()

        data_types = entity.get_data_records_types()
        self.assertEqual(data_types, {"patients": "int", "arv": "int"})