From 5cd43298be1456cbff6e203e71341485ccc4b3e4 Mon Sep 17 00:00:00 2001 From: courtneycb Date: Thu, 13 Aug 2020 17:22:40 +1200 Subject: [PATCH] Use BareResourceGenerator in test suite. --- csunplugged/resources/generators/__init__.py | 2 +- .../resource/structure/basic-config.yaml | 4 +- .../resource/structure/invalid-copies.yaml | 4 +- .../resource/structure/invalid-template.yaml | 4 +- .../resource/structure/invalid-thumbnail.yaml | 2 +- .../resource/structure/missing-copies.yaml | 4 +- .../resource/structure/missing-thumbnail.yaml | 2 +- .../assets/resource/structure/multiple.yaml | 4 +- .../resource/structure/translation.yaml | 4 +- .../resource/structure/trimmed-module.yaml | 4 +- .../resources/loaders/test_resource_loader.py | 4 +- .../tests/resources/models/test_resource.py | 28 ++++----- .../resources/utils/test_get_thumbnail.py | 8 +-- .../utils/test_resource_cache_redirect.py | 10 +-- .../resources/views/test_generate_resource.py | 44 ++++++------- .../tests/resources/views/test_index_view.py | 2 +- .../resources/views/test_resource_view.py | 62 +++++++++---------- .../management/test_rebuild_index_command.py | 8 +-- ...generated-resources-description-empty.yaml | 2 +- ...nerated-resources-description-missing.yaml | 2 +- .../structure/generated-resources.yaml | 2 +- .../topics/loaders/test_lessons_loader.py | 26 ++++---- .../tests/topics/views/test_lesson_view.py | 28 ++++----- 23 files changed, 130 insertions(+), 130 deletions(-) diff --git a/csunplugged/resources/generators/__init__.py b/csunplugged/resources/generators/__init__.py index dbb9349b6..d21b2a74c 100644 --- a/csunplugged/resources/generators/__init__.py +++ b/csunplugged/resources/generators/__init__.py @@ -2,7 +2,7 @@ # Disable unused import warnings for this file # flake8: noqa: F401 - +from tests.resources.BareResourceGenerator import BareResourceGenerator from .ArrowsResourceGenerator import ArrowsResourceGenerator from .BarcodeChecksumPosterResourceGenerator import BarcodeChecksumPosterResourceGenerator from .BinaryCardsResourceGenerator import BinaryCardsResourceGenerator diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/basic-config.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/basic-config.yaml index 9d6147173..53a13aeda 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/basic-config.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/basic-config.yaml @@ -1,4 +1,4 @@ resource-untranslated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png copies: false diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-copies.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-copies.yaml index 41bae2e28..20ed669cb 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-copies.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-copies.yaml @@ -1,4 +1,4 @@ resource-untranslated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png copies: Maybe diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-template.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-template.yaml index 9d6147173..53a13aeda 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-template.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-template.yaml @@ -1,4 +1,4 @@ resource-untranslated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png copies: false diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-thumbnail.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-thumbnail.yaml index 1a05ce8e4..344f54735 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-thumbnail.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/invalid-thumbnail.yaml @@ -1,4 +1,4 @@ resource-untranslated: - generator-module: GridResourceGenerator + generator-module: BareResourceGenerator thumbnail-static-path: missing-image.png copies: false diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/missing-copies.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/missing-copies.yaml index 4705640e2..f24411e57 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/missing-copies.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/missing-copies.yaml @@ -1,3 +1,3 @@ resource-untranslated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/missing-thumbnail.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/missing-thumbnail.yaml index 49b0f21aa..8a3beb036 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/missing-thumbnail.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/missing-thumbnail.yaml @@ -1,3 +1,3 @@ resource-untranslated: - generator-module: GridResourceGenerator + generator-module: BaseResourceGenerator copies: false diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/multiple.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/multiple.yaml index c731fabc6..398230c68 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/multiple.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/multiple.yaml @@ -1,6 +1,6 @@ resource-untranslated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png copies: false resource2-untranslated: generator-module: JobBadgesResourceGenerator diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/translation.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/translation.yaml index 55c644cf9..cfb58a54a 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/translation.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/translation.yaml @@ -1,4 +1,4 @@ resource-translated: - generator-module: GridResourceGenerator - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator + thumbnail-static-path: img/resources/bare/thumbnail.png copies: false diff --git a/csunplugged/tests/resources/loaders/assets/resource/structure/trimmed-module.yaml b/csunplugged/tests/resources/loaders/assets/resource/structure/trimmed-module.yaml index e883c9fc4..c348061e9 100644 --- a/csunplugged/tests/resources/loaders/assets/resource/structure/trimmed-module.yaml +++ b/csunplugged/tests/resources/loaders/assets/resource/structure/trimmed-module.yaml @@ -1,4 +1,4 @@ resource-untranslated: - generator-module: GridResourceGenerator.py - thumbnail-static-path: img/resources/grid/thumbnail.png + generator-module: BareResourceGenerator.py + thumbnail-static-path: img/resources/bare/thumbnail.png copies: false diff --git a/csunplugged/tests/resources/loaders/test_resource_loader.py b/csunplugged/tests/resources/loaders/test_resource_loader.py index 6352a4b64..19937b52e 100644 --- a/csunplugged/tests/resources/loaders/test_resource_loader.py +++ b/csunplugged/tests/resources/loaders/test_resource_loader.py @@ -26,7 +26,7 @@ def test_basic_resource_loader_config(self): self.assertEqual("Resource 1", resource.name) self.assertIn("Description of resource 1", resource.content) self.assertEqual("resource-untranslated", resource.slug) - self.assertEqual("GridResourceGenerator", resource.generator_module) + self.assertEqual("BareResourceGenerator", resource.generator_module) self.assertEqual(False, resource.copies) def test_resource_loader_config_missing_translation_fallback(self): @@ -80,7 +80,7 @@ def test_resource_loader_trimmed_module_value(self): resource_loader.load() self.assertEquals( Resource.objects.get(slug="resource-untranslated").generator_module, - "GridResourceGenerator", + "BareResourceGenerator", ) def test_resource_loader_missing_copies_value(self): diff --git a/csunplugged/tests/resources/models/test_resource.py b/csunplugged/tests/resources/models/test_resource.py index bfa0d01c8..00df8739c 100644 --- a/csunplugged/tests/resources/models/test_resource.py +++ b/csunplugged/tests/resources/models/test_resource.py @@ -10,30 +10,30 @@ def __init__(self, *args, **kwargs): def test_resource_str(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) - self.assertEqual(resource.__str__(), "Grid") + self.assertEqual(resource.__str__(), "Bare") def test_resource_model_name(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) self.assertEqual(resource.MODEL_NAME, "Printable") def test_resource_model_get_absolute_url(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) self.assertEqual( resource.get_absolute_url(), - "/en/resources/grid/" + "/en/resources/bare/" ) diff --git a/csunplugged/tests/resources/utils/test_get_thumbnail.py b/csunplugged/tests/resources/utils/test_get_thumbnail.py index d16429ec1..81da6b30a 100644 --- a/csunplugged/tests/resources/utils/test_get_thumbnail.py +++ b/csunplugged/tests/resources/utils/test_get_thumbnail.py @@ -103,7 +103,7 @@ def test_get_thumbnail_static_path_for_resource_local_development(self): "resource", "Resource", "Description of resource", - "GridResourceGenerator", + "BareResourceGenerator", ) self.assertEqual( get_thumbnail_static_path_for_resource(resource), @@ -117,7 +117,7 @@ def test_get_thumbnail_static_path_for_resource_production_en(self): "resource", "Resource", "Description of resource", - "GridResourceGenerator", + "BareResourceGenerator", ) self.assertEqual( get_thumbnail_static_path_for_resource(resource), @@ -132,7 +132,7 @@ def test_get_thumbnail_static_path_for_resource_production_de(self): "resource", "Resource", "Description of resource", - "GridResourceGenerator", + "BareResourceGenerator", ) self.assertEqual( get_thumbnail_static_path_for_resource(resource), @@ -148,7 +148,7 @@ def test_get_thumbnail_static_path_for_resource_production_in_context(self): "resource", "Resource", "Description of resource", - "GridResourceGenerator", + "BareResourceGenerator", ) self.assertEqual( get_thumbnail_static_path_for_resource(resource), diff --git a/csunplugged/tests/resources/utils/test_resource_cache_redirect.py b/csunplugged/tests/resources/utils/test_resource_cache_redirect.py index 76ae7b5ce..bcc4a5ed9 100644 --- a/csunplugged/tests/resources/utils/test_resource_cache_redirect.py +++ b/csunplugged/tests/resources/utils/test_resource_cache_redirect.py @@ -16,10 +16,10 @@ def __init__(self, *args, **kwargs): def test_resources_cache_valid_resource(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) query = QueryDict("paper_size=a4") generator = get_resource_generator(resource.generator_module, query) @@ -27,5 +27,5 @@ def test_resources_cache_valid_resource(self): self.assertEqual(response.status_code, HTTPStatus.FOUND) self.assertEqual( response.url, - "/staticfiles/resources/grid/en/Grid%20(a4).pdf" + "/staticfiles/resources/bare/en/Bare%20(a4).pdf" ) diff --git a/csunplugged/tests/resources/views/test_generate_resource.py b/csunplugged/tests/resources/views/test_generate_resource.py index 2dc2e3f52..a696a711a 100644 --- a/csunplugged/tests/resources/views/test_generate_resource.py +++ b/csunplugged/tests/resources/views/test_generate_resource.py @@ -16,10 +16,10 @@ def __init__(self, *args, **kwargs): def test_generate_view_valid_slug(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -31,16 +31,16 @@ def test_generate_view_valid_slug(self): self.assertEqual(HTTPStatus.OK, response.status_code) self.assertEqual( response.get("Content-Disposition"), - 'attachment; filename*=UTF-8\'\'Grid%20%28a4%29.pdf; filename="Grid%20%28a4%29.pdf"' + 'attachment; filename*=UTF-8\'\'Bare%20%28a4%29.pdf; filename="Bare%20%28a4%29.pdf"' ) @override_settings(DJANGO_PRODUCTION=True) def test_generate_view_valid_slug_production_cache(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -52,15 +52,15 @@ def test_generate_view_valid_slug_production_cache(self): self.assertEqual(HTTPStatus.FOUND, response.status_code) self.assertEqual( response.url, - "/staticfiles/resources/grid/en/Grid%20(a4).pdf" + "/staticfiles/resources/bare/en/Bare%20(a4).pdf" ) def test_generate_view_valid_slug_missing_parameter(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -71,10 +71,10 @@ def test_generate_view_valid_slug_missing_parameter(self): def test_generate_view_valid_slug_invalid_parameter(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -87,10 +87,10 @@ def test_generate_view_valid_slug_invalid_parameter(self): def test_generate_view_valid_slug_multiple_parameter(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, diff --git a/csunplugged/tests/resources/views/test_index_view.py b/csunplugged/tests/resources/views/test_index_view.py index f4514b826..06bf60aa2 100644 --- a/csunplugged/tests/resources/views/test_index_view.py +++ b/csunplugged/tests/resources/views/test_index_view.py @@ -24,7 +24,7 @@ def test_resources_index_with_one_resource(self): "resource", "Resource", "Description", - "GridResourceGenerator", + "BareResourceGenerator", ) url = reverse("resources:index") response = self.client.get(url) diff --git a/csunplugged/tests/resources/views/test_resource_view.py b/csunplugged/tests/resources/views/test_resource_view.py index 055ceba2c..e29f68ff4 100644 --- a/csunplugged/tests/resources/views/test_resource_view.py +++ b/csunplugged/tests/resources/views/test_resource_view.py @@ -25,10 +25,10 @@ def __init__(self, *args, **kwargs): def test_resource_view_with_valid_slug(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug @@ -39,10 +39,10 @@ def test_resource_view_with_valid_slug(self): def test_resource_view_with_invalid_slug(self): self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": "wrong_slug", @@ -53,10 +53,10 @@ def test_resource_view_with_invalid_slug(self): def test_resource_view_context(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -73,10 +73,10 @@ def test_resource_view_context(self): @override_settings(DJANGO_PRODUCTION=True) def test_resource_view_resource_thumbnail_base_context_production_en(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -85,17 +85,17 @@ def test_resource_view_resource_thumbnail_base_context_production_en(self): response = self.client.get(url) self.assertEqual( response.context["resource_thumbnail_base"], - "/staticfiles/img/resources/grid/thumbnails/{}/".format(self.language) + "/staticfiles/img/resources/bare/thumbnails/{}/".format(self.language) ) @override_settings(DJANGO_PRODUCTION=True) def test_resource_view_resource_thumbnail_base_context_production_de(self): with translation.override("de"): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -104,17 +104,17 @@ def test_resource_view_resource_thumbnail_base_context_production_de(self): response = self.client.get(url) self.assertEqual( response.context["resource_thumbnail_base"], - "/staticfiles/img/resources/grid/thumbnails/de/" + "/staticfiles/img/resources/bare/thumbnails/de/" ) @override_settings(DJANGO_PRODUCTION=True) @override_settings(LANGUAGES=MULTIPLE_LANGUAGES_WITH_INCONTEXT) def test_resource_view_resource_thumbnail_base_context_production_in_context(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) kwargs = { "resource_slug": resource.slug, @@ -126,15 +126,15 @@ def test_resource_view_resource_thumbnail_base_context_production_in_context(sel print(response.context["resource"]) self.assertEqual( response.context["resource_thumbnail_base"], - "/staticfiles/img/resources/grid/thumbnails/en/" + "/staticfiles/img/resources/bare/thumbnails/en/" ) def test_resource_view_lesson_context(self): resource = self.test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) # Create topic data diff --git a/csunplugged/tests/search/management/test_rebuild_index_command.py b/csunplugged/tests/search/management/test_rebuild_index_command.py index b8653b80a..14c965d09 100644 --- a/csunplugged/tests/search/management/test_rebuild_index_command.py +++ b/csunplugged/tests/search/management/test_rebuild_index_command.py @@ -71,10 +71,10 @@ def test_rebuild_index_command_programming_challenge_model(self): def test_rebuild_index_command_resource_model(self): resources_test_data = ResourcesTestDataGenerator() resources_test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) management.call_command("rebuild_index", "--noinput") diff --git a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-empty.yaml b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-empty.yaml index 2a92d4f02..315410e5e 100644 --- a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-empty.yaml +++ b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-empty.yaml @@ -1,4 +1,4 @@ lesson-3: number: 3 generated-resources: - - grid + - bare diff --git a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-missing.yaml b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-missing.yaml index 7f186dc6f..4f004329e 100644 --- a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-missing.yaml +++ b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources-description-missing.yaml @@ -1,4 +1,4 @@ lesson-2: number: 3 generated-resources: - - grid + - bare diff --git a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources.yaml b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources.yaml index e3fdc2781..e5bb79e2e 100644 --- a/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources.yaml +++ b/csunplugged/tests/topics/loaders/assets/lessons/structure/generated-resources.yaml @@ -1,5 +1,5 @@ lesson-1: number: 1 generated-resources: - - grid - arrows + - bare diff --git a/csunplugged/tests/topics/loaders/test_lessons_loader.py b/csunplugged/tests/topics/loaders/test_lessons_loader.py index d2da61e1c..1405bf528 100644 --- a/csunplugged/tests/topics/loaders/test_lessons_loader.py +++ b/csunplugged/tests/topics/loaders/test_lessons_loader.py @@ -625,10 +625,10 @@ def test_lesson_loader_optional_generated_resources_set_correctly(self): topic = self.test_data.create_topic(1) unit_plan = self.test_data.create_unit_plan(topic, 1) self.resource_test_data.create_resource( - "grid", - "Grid", - "Grid description", - "GridResourceGenerator", + "bare", + "Bare", + "Bare description", + "BareResourceGenerator", ) self.resource_test_data.create_resource( "arrows", @@ -647,7 +647,7 @@ def test_lesson_loader_optional_generated_resources_set_correctly(self): Lesson.objects.get(slug="lesson-1").generated_resources.order_by("name"), [ "", - "", + "", ], ) @@ -670,10 +670,10 @@ def test_lesson_loader_optional_generated_resources_description_empty(self): topic = self.test_data.create_topic(1) unit_plan = self.test_data.create_unit_plan(topic, 1) self.resource_test_data.create_resource( - "grid", - "Grid", - "Grid description", - "GridResourceGenerator", + "bare", + "Bare", + "Bare description", + "BareResourceGenerator", ) lesson_loader = LessonsLoader( topic, @@ -691,10 +691,10 @@ def test_lesson_loader_optional_generated_resources_description_missing(self): topic = self.test_data.create_topic(1) unit_plan = self.test_data.create_unit_plan(topic, 1) self.resource_test_data.create_resource( - "grid", - "Grid", - "Grid description", - "GridResourceGenerator", + "bare", + "Bare", + "Bare description", + "BareResourceGenerator", ) lesson_loader = LessonsLoader( topic, diff --git a/csunplugged/tests/topics/views/test_lesson_view.py b/csunplugged/tests/topics/views/test_lesson_view.py index fac55dc71..4d6e430b0 100644 --- a/csunplugged/tests/topics/views/test_lesson_view.py +++ b/csunplugged/tests/topics/views/test_lesson_view.py @@ -343,10 +343,10 @@ def test_lesson_view_ages_context_generated_resources_single(self): age_group_1 ) resource = self.resource_test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) self.test_data.add_lesson_resource_relationship(lesson, resource, 1) kwargs = { @@ -361,9 +361,9 @@ def test_lesson_view_ages_context_generated_resources_single(self): [ { "description": "Description 1", - "slug": "grid", - "name": "Grid", - "thumbnail": "/staticfiles/img/resources/grid/thumbnails/en/grid-paper_size-a4.png", + "slug": "bare", + "name": "Bare", + "thumbnail": "/staticfiles/img/resources/bare/thumbnails/en/bare-paper_size-a4.png", } ] ) @@ -379,10 +379,10 @@ def test_lesson_view_ages_context_generated_resources_multiple(self): age_group_1 ) resource1 = self.resource_test_data.create_resource( - "grid", - "Grid", - "resources/grid.html", - "GridResourceGenerator", + "bare", + "Bare", + "resources/bare.html", + "BareResourceGenerator", ) self.test_data.add_lesson_resource_relationship(lesson, resource1, 1) resource2 = self.resource_test_data.create_resource( @@ -410,9 +410,9 @@ def test_lesson_view_ages_context_generated_resources_multiple(self): }, { "description": "Description 1", - "slug": "grid", - "name": "Grid", - "thumbnail": "/staticfiles/img/resources/grid/thumbnails/en/grid-paper_size-a4.png", + "slug": "bare", + "name": "Bare", + "thumbnail": "/staticfiles/img/resources/bare/thumbnails/en/bare-paper_size-a4.png", }, ] )