'A superuser can be created when a custom user model is in use'

@override_settings(AUTH_USER_MODEL='auth_tests.CustomUser')
def test_swappable_user(self):

    new_io = StringIO()
    call_command('createsuperuser', interactive=False, email='joe@somewhere.org', date_of_birth='1976-04-01', stdout=new_io)
    command_output = new_io.getvalue().strip()
    self.assertEqual(command_output, 'Superuser    created    successfully.')
    u = CustomUser._default_manager.get(email='joe@somewhere.org')
    self.assertEqual(u.date_of_birth, date(1976, 4, 1))
    self.assertFalse(u.has_usable_password())
