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

TransactionTestCase MRO is broken #5547

Closed
gsnider2195 opened this issue Apr 9, 2024 · 0 comments · Fixed by #5548
Closed

TransactionTestCase MRO is broken #5547

gsnider2195 opened this issue Apr 9, 2024 · 0 comments · Fixed by #5548
Labels
type: bug Something isn't working as expected

Comments

@gsnider2195
Copy link
Contributor

Environment

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

Steps to Reproduce

  1. Create a TransactionTestCase and try to use self.client.get("/dcim/devices/")

Expected Behavior

Get a list view response

Observed Behavior

Get a 400 bad request because our TransactionTestCase is inheriting from its base classes in the wrong order. Instead of

class TransactionTestCase(_TransactionTestCase, NautobotTestCaseMixin):

Should be

class TransactionTestCase(NautobotTestCaseMixin, _TransactionTestCase):

Mixins should always come after the base class, in python that means to the left.

@gsnider2195 gsnider2195 added type: bug Something isn't working as expected triage This issue is new and has not been reviewed. labels Apr 9, 2024
@timizuoebideri1 timizuoebideri1 removed the triage This issue is new and has not been reviewed. label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants