'Executing the changepassword management command should change joe\'s password'

def test_that_changepassword_command_changes_joes_password(self):

    self.assertTrue(self.user.check_password(u'qwerty'))
    command = changepassword.Command()
    command._get_pass = (lambda *args: u'not    qwerty')
    command.execute(u'joe', stdout=self.stdout)
    command_output = self.stdout.getvalue().strip()
    self.assertEqual(command_output, u"Changing    password    for    user    'joe'\nPassword    changed    successfully    for    user    'joe'")
    self.assertTrue(models.User.objects.get(username=u'joe').check_password(u'not    qwerty'))
