@@ -871,7 +871,7 @@ def setUpTestData(cls):
871871 cls .ror_svg = ror_svg_template .render ({})
872872
873873 def test_all_custom (self ):
874- template = get_template ("common/elements/affiliation_display .html" )
874+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
875875 org = core_models .Organization .objects .create ()
876876 core_models .OrganizationName (
877877 value = "Birkbeck" ,
@@ -898,52 +898,45 @@ def test_all_custom(self):
898898 "affiliation" : affil ,
899899 }
900900 expected = """
901- <span class="comma-separated">
902- <span>Reader</span>
903- <span>English</span>
904- <span itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
905- <span itemprop="name">
906- <span>Birkbeck</span>
907- </span>
908- </span>
909- <span>London, United Kingdom</span>
910- <span>May 2010–Oct 2016</span>
911- </span>
901+ <li>Reader</li>
902+ <li>English</li>
903+ <li itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
904+ <span itemprop="name">
905+ <span>Birkbeck</span>
906+ </span>
907+ </li>
908+ <li>London, United Kingdom</li>
912909 """
913910 self .assertHTMLEqual (expected , template .render (context ))
914911
915912 def test_title (self ):
916- template = get_template ("common/elements/affiliation_display .html" )
913+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
917914 context = {
918915 "affiliation" : core_models .ControlledAffiliation .objects .create (
919916 account = self .user ,
920917 title = "Reader" ,
921918 ),
922919 }
923920 expected = """
924- <span class="comma-separated">
925- <span>Reader</span>
926- </span>
921+ <li>Reader</li>
927922 """
928923 self .assertHTMLEqual (expected , template .render (context ))
929924
930925 def test_department (self ):
931- template = get_template ("common/elements/affiliation_display .html" )
926+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
932927 context = {
933928 "affiliation" : core_models .ControlledAffiliation .objects .create (
934929 account = self .user ,
935930 department = "English" ,
936931 ),
937932 }
938933 expected = """
939- <span class="comma-separated">
940- <span>English</span>
941- </span>
934+ <li>English</li>
942935 """
943936 self .assertHTMLEqual (expected , template .render (context ))
944937
945938 def test_controlled_org (self ):
946- template = get_template ("common/elements/affiliation_display .html" )
939+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
947940 org , _ = core_models .Organization .objects .get_or_create (
948941 ror_id = "02mb95055" ,
949942 )
@@ -955,22 +948,23 @@ def test_controlled_org(self):
955948 "affiliation" : affil ,
956949 }
957950 expected = f"""
958- <span class="comma-separated">
959- <span itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
960- <a href="https://ror.org/02mb95055" itemprop="url" target="_blank">
961- <span itemprop="name">
962- <span>Birkbeck, University of London</span>
963- </span>
964- <span class="show-for-sr sr-only">(opens in new tab)</span>
965- { self .ror_svg }
966- </a>
967- </span>
951+ <li itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
952+ <span itemprop="name">
953+ <span>Birkbeck, University of London</span>
968954 </span>
955+ <a href="https://ror.org/02mb95055" itemprop="url" target="_blank">
956+ <span class="sr-only show-for-sr">
957+ View ROR record for Birkbeck, University of London.
958+ </span>
959+ <span class="show-for-sr sr-only">(opens in new tab)</span>
960+ { self .ror_svg }
961+ </a>
962+ </li>
969963 """
970964 self .assertHTMLEqual (expected , template .render (context ))
971965
972966 def test_custom_org (self ):
973- template = get_template ("common/elements/affiliation_display .html" )
967+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
974968 org = core_models .Organization .objects .create ()
975969 core_models .OrganizationName (
976970 value = "Birkbeck" ,
@@ -984,18 +978,16 @@ def test_custom_org(self):
984978 "affiliation" : affil ,
985979 }
986980 expected = """
987- <span class="comma-separated">
988- <span itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
989- <span itemprop="name">
990- <span>Birkbeck</span>
991- </span>
992- </span>
981+ <li itemprop="worksFor" itemscope itemtype="http://schema.org/CollegeOrUniversity">
982+ <span itemprop="name">
983+ <span>Birkbeck</span>
993984 </span>
985+ </li>
994986 """
995987 self .assertHTMLEqual (expected , template .render (context ))
996988
997989 def test_location_city (self ):
998- template = get_template ("common/elements/affiliation_display .html" )
990+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
999991 org = core_models .Organization .objects .create ()
1000992 location , _ = core_models .Location .objects .get_or_create (
1001993 name = "London" ,
@@ -1009,14 +1001,12 @@ def test_location_city(self):
10091001 "affiliation" : affil ,
10101002 }
10111003 expected = """
1012- <span class="comma-separated">
1013- <span>London</span>
1014- </span>
1004+ <li>London</li>
10151005 """
10161006 self .assertHTMLEqual (expected , template .render (context ))
10171007
10181008 def test_location_country (self ):
1019- template = get_template ("common/elements/affiliation_display .html" )
1009+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
10201010 org = core_models .Organization .objects .create ()
10211011 country , _ = core_models .Country .objects .get_or_create (
10221012 code = "GB" ,
@@ -1034,44 +1024,40 @@ def test_location_country(self):
10341024 "affiliation" : affil ,
10351025 }
10361026 expected = """
1037- <span class="comma-separated">
1038- <span>United Kingdom</span>
1039- </span>
1027+ <li>United Kingdom</li>
10401028 """
10411029 self .assertHTMLEqual (expected , template .render (context ))
10421030
10431031 def test_start (self ):
1044- template = get_template ("common/elements/affiliation_display .html" )
1032+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
10451033 affil = core_models .ControlledAffiliation .objects .create (
10461034 account = self .user ,
10471035 title = "Independent scholar" ,
10481036 start = timezone .datetime (2010 , 5 , 5 , tzinfo = timezone .utc ),
10491037 )
10501038 context = {
10511039 "affiliation" : affil ,
1040+ "include_dates" : True ,
10521041 }
10531042 expected = """
1054- <span class="comma-separated">
1055- <span>Independent scholar</span>
1056- <span>May 2010–</span>
1057- </span>
1043+ <li>Independent scholar</li>
1044+ <li>May 2010–</li>
10581045 """
10591046 self .assertHTMLEqual (expected , template .render (context ))
10601047
10611048 def test_end (self ):
1062- template = get_template ("common/elements/affiliation_display .html" )
1049+ template = get_template ("common/elements/affiliation_inner_li_details .html" )
10631050 affil = core_models .ControlledAffiliation .objects .create (
10641051 account = self .user ,
10651052 title = "Independent scholar" ,
10661053 end = timezone .datetime (2016 , 10 , 15 , tzinfo = timezone .utc ),
10671054 )
10681055 context = {
10691056 "affiliation" : affil ,
1057+ "include_dates" : True ,
10701058 }
10711059 expected = """
1072- <span class="comma-separated">
1073- <span>Independent scholar</span>
1074- <span>–Oct 2016</span>
1075- </span>
1060+ <li>Independent scholar</li>
1061+ <li>–Oct 2016</li>
10761062 """
10771063 self .assertHTMLEqual (expected , template .render (context ))
0 commit comments