'Ensure that a user\'s password is set to an unusable_password.'

def test_unusable_password(self):

    user = User.objects.create(username=TEST_USERNAME, email=TEST_EMAIL)
    self.assertEqual([(TEST_USERNAME, TEST_EMAIL)], [(u.username, u.email) for u in User.objects.all()])
    user.set_password(User.objects.make_random_password())
    user.save()
    call_command('manage_user', TEST_USERNAME, TEST_EMAIL)
    user = User.objects.get(username=TEST_USERNAME, email=TEST_EMAIL)
    self.assertTrue(user.has_usable_password())
    call_command('manage_user', TEST_USERNAME, TEST_EMAIL, '--unusable-password')
    user = User.objects.get(username=TEST_USERNAME, email=TEST_EMAIL)
    self.assertFalse(user.has_usable_password())
    call_command('manage_user', TEST_USERNAME, TEST_EMAIL, '--unusable-password')
    self.assertFalse(user.has_usable_password())
