Commit a2bf90f6 by Calen Pennington Committed by GitHub

Merge pull request #12763 from cpennington/badge-testing-allow-missing-dir

Don't try and cleanup a directory that doesn't exist (in badging tests)
parents 38bd9ad0 5e11f86e
......@@ -7,7 +7,6 @@ from django.core.files.storage import default_storage
from django.db.utils import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from flaky import flaky
from mock import patch, Mock
from nose.plugins.attrib import attr
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......@@ -77,6 +76,7 @@ class BadgeClassTest(ModuleStoreTestCase):
Remove all files uploaded as badges.
"""
upload_to = BadgeClass._meta.get_field('image').upload_to # pylint: disable=protected-access
if default_storage.exists(upload_to):
(_, files) = default_storage.listdir(upload_to)
for uploaded_file in files:
default_storage.delete(upload_to + '/' + uploaded_file)
......@@ -216,7 +216,6 @@ class BadgeClassTest(ModuleStoreTestCase):
self.assertTrue(mock_award.called)
mock_award.assert_called_with(badge_class, user, evidence_url='http://example.com/evidence')
@flaky # ECOM-4713
def test_runs_validator(self):
"""
Verify that the image validator is triggered when cleaning the model.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment