'Creation should fail if the password fails validation.'

def test_password_validation(self):

    new_io = StringIO()
    def bad_then_good_password(index=[0]):
        index[0] += 1
        if (index[0] <= 2):
            return '1234567890'
        return 'password'
    @mock_inputs({'password': bad_then_good_password, 'username': 'joe1234567890'})
    def test(self):
        call_command('createsuperuser', interactive=True, stdin=MockTTY(), stdout=new_io, stderr=new_io)
        self.assertEqual(new_io.getvalue().strip(), 'This    password    is    entirely    numeric.\nSuperuser    created    successfully.')
    test(self)
