refactor: replace some create_user with UserFactory to avoid non-existent profile errors

This commit is contained in:
Maria Grimaldi
2021-08-23 17:55:03 -04:00
parent b7dfaa9b17
commit 2ee52ea96c
24 changed files with 142 additions and 86 deletions

View File

@@ -10,7 +10,6 @@ from uuid import UUID, uuid4
import ddt
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.cache import cache
from django.test import override_settings
from django.urls import reverse
@@ -499,7 +498,7 @@ class ProgramEnrollmentsPostTests(ProgramEnrollmentsWriteMixin, APITestCase):
'curriculum_uuid': str(self.curriculum_uuid)
}
]
user = User.objects.create_user('test_user', 'test@example.com', 'password')
user = UserFactory.create(username='test_user', email='test@example.com', password='password')
url = self.get_url()
with mock.patch(
_get_users_patch_path,