'Executing the changepassword management command with a database option
should operate on the specified DB'

def test_that_changepassword_command_with_database_option_uses_given_db(self):

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