Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwood committed Dec 18, 2024
1 parent b7675b3 commit 28cbce6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

<h2>Data Accuracy</h2>

{% if validation_errors or additional_closed_codelist_values %}
<p>Caution: The data provided did not pass <a href="#validity">validation</a> therefore the accuracy of the data could not be fully determined.</a>
{% if validation_and_closed_codelist_errors_count > 0 %}
<p><strong>Caution:</strong> The data provided did <a href="#validity">not pass validation</a>, therefore the accuracy of the data could not be fully determined.</a>
{% endif %}

{% if quality_accuracy_checks_passed %}
{% if quality_accuracy_checks_passed and validation_and_closed_codelist_errors_count == 0 %}
<h3>What is working well</h3>
<p><i class="material-icons table--true">check</i>Congratulations, <strong>{{quality_accuracy_checks_passed|length}}</strong> of our data accuracy checks passed.</p>
{% endif %}


{% if quality_accuracy_errored %}
<p>{% blocktrans %}Quality accuracy checks failed due to an issue with the data. Fix some <a href="#validity">validation</a> errors first.{% endblocktrans %}</p>
{% else %}
<p>{% blocktrans %}Some Quality Accuracy checks failed due to an issue with the data. Fix some <a href="#validity">validation</a> errors first.{% endblocktrans %}</p>
{% endif %}

{% if quality_accuracy_checks %}
<h3>Potential issues</h3>
Expand Down Expand Up @@ -87,5 +87,3 @@ <h4>{{category}}</h4>
{% endif %}
{% endwith %}
{% endfor %}

{% endif %} {# Quality accuracy errored #}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3 class="box__heading">This data could not be converted ({% blocktrans count n

{% if conversion == 'flatten' %}
<div class="box box--teal margin-top:1">
<h3 class="box__heading">File conversion successful</h3>
<h3 class="box__heading" id="file-conversion-success-heading">File conversion successful</h3>
<p >We have converted your JSON data into spreadsheet format. See <a href="#download-and-share">Download and share</a> for more details.</p>
</div>
{% endif %}
Expand Down Expand Up @@ -74,6 +74,7 @@ <h3 class="box__heading">File conversion successful</h3>
</ol>

{% if conversion_warning_messages or conversion_error %}
<div id="conversion-errors-area">
<hr class="separator-light">
<h3 id="conversion-errors">
{% trans "Data conversion unsuccessful - " %}
Expand All @@ -97,6 +98,7 @@ <h3 id="conversion-errors">
</ul>
<p>{% trans "Please resolve this error, as well as any others found, and test the data again." %} <a href="{% url 'index' %}">Load new file.</a> </p>
{% endif %}
</div>
{% endif %} {# / if conversion errors #}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

<h2>Usefulness Opportunities</h2>

{% if validation_errors or additional_closed_codelist_values %}
<p>Caution: The data provided did not pass <a href="#validity">validation</a> therefore the usefulness of the data could not be fully determined.</a>
{% if validation_and_closed_codelist_errors_count > 0 %}
<p><strong>Caution:</strong> The data provided did <a href="#validity">not pass validation</a>, therefore the usefulness of the data could not be fully determined.</a>
{% endif %}

{% if usefulness_checks_passed %}
{% if usefulness_checks_passed and validation_and_closed_codelist_errors_count == 0 %}
<h3>What is working well</h3>
<p><i class="material-icons table--true">check</i>Congratulations, <strong>{{usefulness_checks_passed|length}}</strong> of our usefulness checks passed.</p>
{% endif %}
Expand All @@ -17,7 +17,7 @@ <h3>What is working well</h3>
{% if usefulness_checks_count %}
<h3>Potential opportunities</h3>
{% if usefulness_checks_errored %}
<p>{% blocktrans %}Usefulness checks failed due to an issue with the data. Fix some validation errors first.{% endblocktrans %}</p>
<p>{% blocktrans %}Some Usefulness checks failed due to an issue with the data. Fix some validation errors first.{% endblocktrans %}</p>
{% endif %}

{% if usefulness_checks %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ <h2 class="base-card__title">
<div class="base-card base-card--yellow">
<div class="base-card__content">
<h2 class="base-card__title">
{% if validation_and_closed_codelist_errors_count %}
0
{% if validation_and_closed_codelist_errors_count > 0 %}
?
{% else %}
{{quality_accuracy_checks_count}}
{% endif %}
Expand All @@ -56,8 +56,8 @@ <h2 class="base-card__title">
<div class="base-card base-card--teal">
<div class="base-card__content">
<h2 class="base-card__title">
{% if validation_and_closed_codelist_errors_count %}
0
{% if validation_and_closed_codelist_errors_count > 0 %}
?
{% else %}
{{usefulness_checks_count }}
{% endif %}
Expand Down Expand Up @@ -98,7 +98,7 @@ <h2 class="base-card__title">
href="#accuracy"
id="accuracy-tab-link"
>
{% trans "Accuracy" %} ({% if validation_and_closed_codelist_errors_count %}0{% else %}{{quality_accuracy_checks_count}}{% endif %})
{% trans "Accuracy" %} ({% if validation_and_closed_codelist_errors_count %}?{% else %}{{quality_accuracy_checks_count}}{% endif %})
</a>
</span>

Expand All @@ -108,7 +108,7 @@ <h2 class="base-card__title">
href="#usefulness"
id="usefulness-tab-link"
>
{% trans "Usefulness" %} ({% if validation_and_closed_codelist_errors_count %}0{% else %}{{usefulness_checks_count }}{% endif %})
{% trans "Usefulness" %} ({% if validation_and_closed_codelist_errors_count %}?{% else %}{{usefulness_checks_count }}{% endif %})
</a>
</span>
</div>
Expand Down
12 changes: 5 additions & 7 deletions cove/cove_360/tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,18 @@ def mockflatten(input_name, output_name, *args, **kwargs):

warning_heading = "Data conversion unsuccessful - 1 Error has been found"

conversion_title = browser.find_element(By.ID, "conversion-errors")
conversion_title_text = conversion_title.text

if iserror:
conversion_title_text = browser.find_element(By.ID, "conversion-errors").text
if flatten_or_unflatten == 'flatten':
assert warning_heading in conversion_title_text
else:
# why does this repeat the above..
assert warning_heading in conversion_title_text
assert warning_args[0] in browser.find_element(By.ID, "conversion-area").text
assert warning_args[0] in browser.find_element(By.ID, "conversion-errors-area").text
else:
if flatten_or_unflatten == 'flatten':
assert warning_heading not in conversion_title_text
else:
assert warning_heading not in conversion_title_text
success_title_text = browser.find_element(By.ID, "file-conversion-success-heading").text
assert "File conversion successful" in success_title_text


@pytest.mark.parametrize(('source_filename'), [
Expand Down
6 changes: 4 additions & 2 deletions lib360dataquality/cove/threesixtygiving.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,10 @@ def __init__(self, **kw):
self.funding_organisation_names = {}

def process(self, grant, path_prefix):
# Some test data doesn't have the full valid grant
if "fundingOrganization" not in grant:
return

for num, organisation in enumerate(grant["fundingOrganization"]):
org_id = organisation["id"]
name = organisation["name"]
Expand All @@ -1809,8 +1813,6 @@ def process(self, grant, path_prefix):
self.message = mark_safe(self.check_text["message"][self.grants_percentage])




# Default tests run in CoVE, these are also the base list
# for the Quality Dashboard checks.
TEST_CLASSES = {
Expand Down

0 comments on commit 28cbce6

Please sign in to comment.