Small fixes to LMS unit 1 failures in Django 1.11 tests

This commit is contained in:
bmedx
2018-01-04 15:14:57 -05:00
parent 792d0db5da
commit 95e76dcafe
5 changed files with 12 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
Tests for the Badges app models.
"""
import pytest
from path import Path
from django.core.exceptions import ValidationError
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
@@ -33,10 +34,14 @@ def get_image(name):
@attr(shard=1)
@override_settings(MEDIA_ROOT=TEST_DATA_ROOT)
class BadgeImageConfigurationTest(TestCase):
"""
Test the validation features of BadgeImageConfiguration.
"""
def tearDown(self):
tmp_path = Path(TEST_DATA_ROOT / 'course_complete_badges')
Path.rmtree_p(tmp_path)
@pytest.mark.django111_expected_failure
def test_no_double_default(self):
@@ -66,6 +71,7 @@ class DummyBackend(object):
award = Mock()
@override_settings(MEDIA_ROOT=TEST_DATA_ROOT)
class BadgeClassTest(ModuleStoreTestCase):
"""
Test BadgeClass functionality
@@ -157,7 +163,7 @@ class BadgeClassTest(ModuleStoreTestCase):
self.assertEqual(badge_class.description, 'This is a test')
self.assertEqual(badge_class.criteria, 'https://example.com/test_criteria')
self.assertEqual(badge_class.display_name, 'Super Badge')
self.assertEqual(badge_class.image.name.rsplit('/', 1)[-1], 'good.png')
self.assertTrue('good' in badge_class.image.name.rsplit('/', 1)[-1])
def test_get_badge_class_nocreate(self):
"""