From 736a94ca48f0ee0e6b7fa7c12d16ccccc5c00719 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Wed, 4 Oct 2023 15:44:07 +1030 Subject: [PATCH] chore: fixes PytestCollectionWarnings --- tests/openedx_tagging/core/tagging/test_models.py | 14 +++++++------- .../core/tagging/test_system_defined_models.py | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/openedx_tagging/core/tagging/test_models.py b/tests/openedx_tagging/core/tagging/test_models.py index 6c1d852e..07b73e7d 100644 --- a/tests/openedx_tagging/core/tagging/test_models.py +++ b/tests/openedx_tagging/core/tagging/test_models.py @@ -144,7 +144,7 @@ def setup_tag_depths(self): tag.depth = 2 -class TestTaxonomySubclassA(Taxonomy): +class TaxonomyTestSubclassA(Taxonomy): """ Model A for testing the taxonomy subclass casting. """ @@ -155,7 +155,7 @@ class Meta: app_label = "oel_tagging" -class TestTaxonomySubclassB(TestTaxonomySubclassA): +class TaxonomyTestSubclassB(TaxonomyTestSubclassA): """ Model B for testing the taxonomy subclass casting. """ @@ -166,7 +166,7 @@ class Meta: app_label = "oel_tagging" -class TestObjectTagSubclass(ObjectTag): +class ObjectTagTestSubclass(ObjectTag): """ Model for testing the ObjectTag copy. """ @@ -200,9 +200,9 @@ def test_representations(self): def test_taxonomy_cast(self): for subclass in ( - TestTaxonomySubclassA, + TaxonomyTestSubclassA, # Ensure that casting to a sub-subclass works as expected - TestTaxonomySubclassB, + TaxonomyTestSubclassB, # and that we can un-set the subclass None, ): @@ -349,11 +349,11 @@ def test_representations(self): ) def test_cast(self): - copy_tag = TestObjectTagSubclass.cast(self.object_tag) + copy_tag = ObjectTagTestSubclass.cast(self.object_tag) assert ( str(copy_tag) == repr(copy_tag) - == " object:id:1: Life on Earth=Bacteria" + == " object:id:1: Life on Earth=Bacteria" ) def test_object_tag_name(self): diff --git a/tests/openedx_tagging/core/tagging/test_system_defined_models.py b/tests/openedx_tagging/core/tagging/test_system_defined_models.py index 09f7b2bc..3c0cb676 100644 --- a/tests/openedx_tagging/core/tagging/test_system_defined_models.py +++ b/tests/openedx_tagging/core/tagging/test_system_defined_models.py @@ -32,7 +32,7 @@ class EmptyTestClass: """ -class TestLPTaxonomy(ModelSystemDefinedTaxonomy): +class LPTaxonomyTest(ModelSystemDefinedTaxonomy): """ Model used for testing - points to LearningPackage instances """ @@ -54,7 +54,7 @@ class Meta: app_label = "oel_tagging" -class CaseInsensitiveTitleLPTaxonomy(TestLPTaxonomy): +class CaseInsensitiveTitleLPTaxonomy(LPTaxonomyTest): """ Model that points to LearningPackage instances but uses 'title' as values """ @@ -89,8 +89,8 @@ def setUpClass(cls): # Create two learning packages and a taxonomy that can tag any object using learning packages as tags: cls.learning_pkg_1 = cls._create_learning_pkg(key="p1", title="Learning Package 1") cls.learning_pkg_2 = cls._create_learning_pkg(key="p2", title="Learning Package 2") - cls.lp_taxonomy = TestLPTaxonomy.objects.create( - taxonomy_class=TestLPTaxonomy, + cls.lp_taxonomy = LPTaxonomyTest.objects.create( + taxonomy_class=LPTaxonomyTest, name="LearningPackage Taxonomy", allow_multiple=True, )