From 175142b6f5b83d2b84b71d223cec17359221a287 Mon Sep 17 00:00:00 2001 From: Hielke Kramer Date: Thu, 11 Jun 2020 20:14:39 +0200 Subject: [PATCH] Added more descriptive error message in validate_import() --- src/bouwdossiers/batch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bouwdossiers/batch.py b/src/bouwdossiers/batch.py index f5a8e0e..17f3c95 100644 --- a/src/bouwdossiers/batch.py +++ b/src/bouwdossiers/batch.py @@ -471,6 +471,9 @@ def validate_import(min_bouwdossiers_count): assert result['total'] > min_bouwdossiers_count, \ f'Imported total of {result["total"]} bouwdossiers is less than the required number {min_bouwdossiers_count}' - assert result['has_panden'] > 0.8 * result['total'] + assert result['has_panden'] > 0.8 * result['total'], \ + f"{result['has_panden']} number of records of a total of {result['total']} records " \ + f"({result['has_panden'] / result['total'] * 100}%) has one or more panden, " \ + f"which is less than the required minimum of {0.8 * result['total']} (80%)" assert result['has_nummeraanduidingen'] > 0.8 * result['total'] assert result['has_openbareruimte_id'] > 0.95 * result['total']