mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Don't override MEDIA_ROOT for avatar tests
This commit is contained in:
parent
651af6370f
commit
ad7bf892eb
@ -16,8 +16,6 @@ from wagtail.admin.utils import (
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.users.models import UserProfile
|
||||
|
||||
TMP_MEDIA_ROOT = tempfile.mktemp()
|
||||
|
||||
|
||||
class TestAuthentication(TestCase, WagtailTestUtils):
|
||||
"""
|
||||
@ -502,7 +500,6 @@ class TestAvatarSection(TestCase, WagtailTestUtils):
|
||||
self.assertTemplateUsed(response, 'wagtailadmin/account/change_avatar.html')
|
||||
self.assertContains(response, "Change profile picture")
|
||||
|
||||
@override_settings(MEDIA_ROOT=TMP_MEDIA_ROOT)
|
||||
def test_set_custom_avatar_stores_and_get_custom_avatar(self):
|
||||
response = self.client.post(reverse('wagtailadmin_account_change_avatar'),
|
||||
{'avatar': self.avatar},
|
||||
@ -513,7 +510,6 @@ class TestAvatarSection(TestCase, WagtailTestUtils):
|
||||
profile = UserProfile.get_for_user(get_user_model().objects.get(pk=self.user.pk))
|
||||
self.assertIn(os.path.basename(self.avatar.name), profile.avatar.url)
|
||||
|
||||
@override_settings(MEDIA_ROOT=TMP_MEDIA_ROOT)
|
||||
def test_user_upload_another_image_removes_previous_one(self):
|
||||
response = self.client.post(reverse('wagtailadmin_account_change_avatar'),
|
||||
{'avatar': self.avatar},
|
||||
|
Loading…
Reference in New Issue
Block a user