'When creating redirects, dodge existing docs\' titles and slugs.'

def _test_collision_avoidance(self, attr, other_attr, template):

    kwargs = {other_attr: (template % {'old': getattr(self.d, other_attr), 'number': 1})}
    DocumentFactory(locale=self.d.locale, **kwargs)
    setattr(self.d, attr, 'new')
    self.d.save()
    redirect = Document.objects.get(**{attr: getattr(self, ('old_' + attr))})
    eq_((template % dict(old=getattr(self.d, other_attr), number=2)), getattr(redirect, other_attr))
