Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

feat: add A11yReport model #101

Merged
merged 3 commits into from
Aug 24, 2021
Merged

feat: add A11yReport model #101

merged 3 commits into from
Aug 24, 2021

Conversation

maxneuvians
Copy link
Contributor

This PR adds the A11yReport model as defined in #9. It also adds better checks for JSONB fields in other models.

@maxneuvians maxneuvians requested a review from dj2 August 24, 2021 20:11
@@ -42,5 +42,5 @@ class TemplateScan(Base):

@validates("data")
def validate_data(self, _key, value):
assert value != ""
assert value is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still catch "" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that just becomes an empty json string, which is not deal either. I will add both tests

session.commit()


def test_a11y_report_empty_productfails(scan_fixture, session):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar version of these tests by product="" instead of just missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes those get caught:

    @validates("product")
    def validate_product(self, _key, value):
>       assert value != ""
E       AssertionError

@maxneuvians maxneuvians merged commit 033052b into main Aug 24, 2021
@maxneuvians maxneuvians deleted the feat/a11y_reports_model branch August 24, 2021 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants