Fix a regression with renaming models.

Review Request #8310 — Created July 27, 2016 and submitted

Information

Django Evolution
release-0.7.x
ef22f77...

Reviewers

A recent change (made since the last public release) implemented fixes
for renaming models. However, it resulted in a breakage in the case
where a baseline contained the signature for the renamed model along
with the original model. In this case, since the new name was found in
the signature, the mutation was considered unnecessary and removed, but
this wasn't actually correct, leading to an evolution failure.

We now only remove that mutation if the new name exists and the old one
does not, fixing renames for models.

Unit tests pass.

Tested against a database schema we had that failed to upgrade after
the recent fix for renames.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        django_evolution/mutators.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/mutators.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (0778c3a)