def test_clean_username_false(self):
        # Instantiate the form with the same username as self.user
        form = MyUserCreationForm({
            'username': self.user.username,
            'password1': '123456',
            'password2': '123456',
        })
        # Run is_valid() to trigger the validation, which is going to fail
        # because the username is already taken
        valid = form.is_valid()
        self.assertFalse(valid)

        # The form.errors dict should contain a single error called 'username'
        self.assertTrue(len(form.errors) == 1)
        self.assertTrue('username' in form.errors)
dataset/ETHPy150Open pydanny/cookiecutter-django/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py/TestMyUserCreationForm.test_clean_username_false/original