'Checks that dimensions are updated correctly in various situations.'

def test_dimensions(self):

    p = self.PersonModel(name='Joe')
    p.mugshot.save('mug', self.file1)
    self.check_dimensions(p, 4, 8)
    p = self.PersonModel.objects.get(name='Joe')
    self.assertEqual(p.mugshot.was_opened, False)
    self.check_dimensions(p, 4, 8)
    self.assertEqual(p.mugshot.was_opened, True)
    p.mugshot.was_opened = False
    self.check_dimensions(p, 4, 8)
    self.assertEqual(p.mugshot.was_opened, False)
    p.mugshot = self.file2
    self.check_dimensions(p, 8, 4)
    self.assertEqual(p.mugshot.was_opened, True)
