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

test_get_object_with_permission display check doesn't account for special HTML characters #3083

Closed
glennmatthews opened this issue Jan 5, 2023 · 0 comments · Fixed by #3608
Assignees
Labels
type: bug Something isn't working as expected

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Nautobot version (Docker tag too if applicable): 1.5.7
  • Python version: any
  • Database platform, version: any
  • Middleware(s): standard

Steps to Reproduce

  1. Create a model whose display or __str__ representation contains special characters such as ", <, >
  2. Create standard Nautobot views for this model
  3. Use Nautobot's ViewTestCases to test this model

Expected Behavior

Tests to pass

Observed Behavior

Test test_get_object_with_permission fails because it expects the literal string representation of the object to appear in the HTML response, not accounting for HTML escapes &quot;, &lt;, &gt;:

AssertionError: 'Metadata for Location "Floor 1"' not found in
... 
Metadata for Location &quot;Floor 1&quot;
...
@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Jan 5, 2023
@glennmatthews glennmatthews self-assigned this Apr 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant