Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use regex for test that involves a content type ID #725

Merged
merged 7 commits into from
Nov 8, 2022
Merged

Conversation

munnsmunns
Copy link
Collaborator

@munnsmunns munnsmunns commented Nov 7, 2022

Replaces a hard coded value for content type ID in a test with a regex to make that test more resilient.

Prior to this, whenever new django models are added, the content-type IDs may change, which can break tests.

Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

If you change the CT in api-visual-barchart.json and api-visual-rob-heatmap.json, as will happen in the future, this will fail, is that correct?

image

I think we need to update the things that compare the JSON for this and the others in the screenshot to replace obj_ct=\d+ with obj_ct=9999 on the write to disk as well. That way when the obj_ct changes the ct will always be the same...

Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

nice job!

@munnsmunns munnsmunns merged commit 310e6c2 into main Nov 8, 2022
@munnsmunns munnsmunns deleted the obj-ct-tests branch November 8, 2022 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants