@@ -223,7 +223,7 @@ def test_fetch_missing_course_metadata_task(self, mock_update_data_from_discover
223
223
"""
224
224
test_course = 'course:edX+testX'
225
225
course_content_metadata = ContentMetadataFactory .create (content_type = COURSE )
226
- ContentMetadataFactory .create (content_type = PROGRAM , json_metadata = {
226
+ ContentMetadataFactory .create (content_type = PROGRAM , _json_metadata = {
227
227
'courses' : [
228
228
course_content_metadata .json_metadata ,
229
229
{
@@ -489,7 +489,7 @@ def test_update_full_metadata(self, mock_oauth_client, mock_partition_course_key
489
489
# the normalized metadata serializer.
490
490
metadata_4 = ContentMetadataFactory (content_type = COURSE , content_key = course_key_4 )
491
491
metadata_4 .catalog_queries .set ([self .catalog_query ])
492
- metadata_4 .json_metadata ['advertised_course_run_uuid' ] = None
492
+ metadata_4 ._json_metadata ['advertised_course_run_uuid' ] = None # pylint: disable=protected-access
493
493
metadata_4 .save ()
494
494
non_course_metadata = ContentMetadataFactory (content_type = COURSE_RUN , content_key = non_course_key )
495
495
non_course_metadata .catalog_queries .set ([self .catalog_query ])
@@ -714,7 +714,7 @@ def test_update_full_metadata_exec_ed(self, mock_oauth_client, mock_partition_co
714
714
715
715
# Simulate a pre-existing ContentMetadata object freshly seeded using the response from /api/v1/search/all/
716
716
course_metadata = ContentMetadataFactory .create (
717
- content_type = COURSE , content_key = course_key , json_metadata = {
717
+ content_type = COURSE , content_key = course_key , _json_metadata = {
718
718
'aggregation_key' : 'course:edX+testX' ,
719
719
'key' : 'edX+testX' ,
720
720
'course_type' : EXEC_ED_2U_COURSE_TYPE ,
@@ -801,7 +801,8 @@ def setUp(self):
801
801
self .course_metadata_published .catalog_queries .set ([self .enterprise_catalog_query ])
802
802
self .course_metadata_published .tags .set ([self .tag1 ])
803
803
self .course_metadata_unpublished = ContentMetadataFactory (content_type = COURSE , content_key = 'course-2' )
804
- self .course_metadata_unpublished .json_metadata .get ('course_runs' )[0 ].update ({
804
+ # pylint: disable=protected-access
805
+ self .course_metadata_unpublished ._json_metadata .get ('course_runs' )[0 ].update ({
805
806
'status' : 'unpublished' ,
806
807
})
807
808
self .course_metadata_unpublished .catalog_queries .set ([self .enterprise_catalog_query ])
@@ -821,7 +822,7 @@ def setUp(self):
821
822
content_type = COURSE_RUN ,
822
823
parent_content_key = 'course-2' ,
823
824
)
824
- self .course_run_metadata_unpublished .json_metadata .update ({
825
+ self .course_run_metadata_unpublished ._json_metadata .update ({
825
826
'status' : 'unpublished' ,
826
827
})
827
828
self .course_run_metadata_unpublished .catalog_queries .set ([course_run_catalog_query ])
@@ -874,7 +875,7 @@ def test_add_metadata_to_algolia_objects_skips_metadata_records_over_max_size(se
874
875
short_description_string = "ayylmao" .join (["" for x in range (50000 )])
875
876
full_description_string = "foobar" .join (["" for x in range (50000 )])
876
877
too_big_sized_course = ContentMetadataFactory (content_type = COURSE , content_key = 'test-course-2' )
877
- too_big_sized_course .json_metadata .update (
878
+ too_big_sized_course ._json_metadata .update ( # pylint: disable=protected-access
878
879
{"short_description" : short_description_string , "full_description" : full_description_string }
879
880
)
880
881
too_big_sized_course .save ()
@@ -1216,7 +1217,7 @@ def test_index_algolia_published_course_to_program(self, mock_search_client):
1216
1217
program_2 = ContentMetadataFactory (content_type = PROGRAM , content_key = 'program-2' )
1217
1218
1218
1219
# Make program-2 hidden to make it "non-indexable". Later we will assert that it will not get indexed.
1219
- program_2 .json_metadata .update ({
1220
+ program_2 ._json_metadata .update ({ # pylint: disable=protected-access
1220
1221
'hidden' : True ,
1221
1222
})
1222
1223
program_2 .save ()
@@ -1324,7 +1325,7 @@ def test_index_algolia_unpublished_course_to_program(self, mock_search_client):
1324
1325
program_2 .catalog_queries .set ([self .enterprise_catalog_query ])
1325
1326
1326
1327
# Make program-2 hidden to make it "non-indexable". Later we will assert that it will not get indexed.
1327
- program_2 .json_metadata .update ({
1328
+ program_2 ._json_metadata .update ({ # pylint: disable=protected-access
1328
1329
'hidden' : True ,
1329
1330
})
1330
1331
program_2 .save ()
@@ -1635,7 +1636,7 @@ def test_index_algolia_program_to_pathway(self, mock_search_client):
1635
1636
program_1 .catalog_queries .set ([self .enterprise_catalog_query ])
1636
1637
1637
1638
# Make program-2 hidden to make it "non-indexable". Later we will assert that it will not get indexed.
1638
- program_2 .json_metadata .update ({
1639
+ program_2 ._json_metadata .update ({ # pylint: disable=protected-access
1639
1640
'hidden' : True ,
1640
1641
})
1641
1642
program_2 .save ()
@@ -1772,15 +1773,15 @@ def test_index_algolia_all_uuids(self, mock_search_client):
1772
1773
program_for_main_course = ContentMetadataFactory (content_type = PROGRAM , content_key = 'program-1' )
1773
1774
# Make the program hidden to make it "non-indexable", but ensure that it still gets indexed due to being related
1774
1775
# to an indexable course.
1775
- program_for_main_course .json_metadata .update ({
1776
+ program_for_main_course ._json_metadata .update ({ # pylint: disable=protected-access
1776
1777
'hidden' : True ,
1777
1778
})
1778
1779
program_for_main_course .save ()
1779
1780
program_for_pathway = ContentMetadataFactory (content_type = PROGRAM , content_key = 'program-2' )
1780
1781
program_for_pathway .catalog_queries .set ([self .enterprise_catalog_query ])
1781
1782
# Make the program hidden to make it "non-indexable", but ensure that it still gets indexed due to being related
1782
1783
# to an indexable pathway.
1783
- program_for_pathway .json_metadata .update ({
1784
+ program_for_pathway ._json_metadata .update ({ # pylint: disable=protected-access
1784
1785
'hidden' : True ,
1785
1786
})
1786
1787
program_for_pathway .save ()
0 commit comments