Move JSONField test model to a higher scope.

Review Request #13489 — Created Jan. 8, 2024 and submitted

Information

Djblets
release-5.x

Reviewers

We had a bunch of unit tests for the JSONField implementation that were
defining a test model inside the test case itself. This led to warnings
about the model being reregistered. Django doesn't provide a way to
unregister a model at runtime, so our best option for fixing this is to
make sure that the model is only registered once, by moving it up to the
file scope.

Ran unit tests and saw that the warning was gone.

Summary ID
Move JSONField test model to a higher scope.
We had a bunch of unit tests for the JSONField implementation that were defining a test model inside the test case itself. This led to warnings about the model being reregistered. Django doesn't provide a way to unregister a model at runtime, so our best option for fixing this is to make sure that the model is only registered once, by moving it up to the file scope. Testing Done: Ran unit tests and saw that the warning was gone.
eb015a926777cfacb79de928f22f9ee560a98ece
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (893848d)