Add additional checks for baseline signature integrity.

Review Request #11216 — Created Oct. 13, 2020 and submitted

Information

Django Evolution
master

Reviewers

Through some debugging and development, I've hit situations in which an
expected model signature could be missing, causing an error far enough
in the process to make the situation hard to debug.

To address this, this change adds some enhanced signature checking in
MockModel, MockMeta, and the base ModelMutator.

The mock support are just assertion checks that stops logic from getting
too far if something goes very wrong.

The ModelMutator checks are more comprehensive. There's no longer an
assumption that a model signature can be returned. It checks, and if one
cannot be found, a suitable exception is raised so that it can be
handled.

While here, a fix to a previous exception has been added, fixing a crash
due to a lack of missing exception message.

Unit tests are in place to ensure the exceptions are raised.

Unit tests pass.

Verified this resulted in a much more reasonable error in the sort of
pathological condition I hit.

Summary ID
Add additional checks for baseline signature integrity.
Through some debugging and development, I've hit situations in which an expected model signature could be missing, causing an error far enough in the process to make the situation hard to debug. To address this, this change adds some enhanced signature checking in `MockModel`, `MockMeta`, and the base `ModelMutator`. The mock support are just assertion checks that stops logic from getting too far if something goes very wrong. The `ModelMutator` checks are more comprehensive. There's no longer an assumption that a model signature can be returned. It checks, and if one cannot be found, a suitable exception is raised so that it can be handled. While here, a fix to a previous exception has been added, fixing a crash due to a lack of missing exception message. Unit tests are in place to ensure the exceptions are raised.
85eb7bc3342845ac0c3bd7b57182a07c774f94df
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (6aab579)