'Test management command with invalid site domain.'

@ddt.data('y', 'n')
def test_with_invalid_site_domain(self, populate):

    fake_site_domain = 'fake-site-domain'
    with mock.patch('__builtin__.raw_input', return_value=populate):
        call_command('populate_created_on_site_user_attribute', '--users', self.user_ids, '--site-domain', fake_site_domain)
    for user in self.users:
        if (populate == 'y'):
            self.assertEqual(UserAttribute.get_user_attribute(user, CREATED_ON_SITE), fake_site_domain)
        else:
            self.assertIsNone(UserAttribute.get_user_attribute(user, CREATED_ON_SITE))
