@@ -133,20 +133,10 @@ def test_can_view_detail_page(self):
133
133
study_start_date = self .browser .find_element_by_id (
134
134
'study_startdate' ).text
135
135
self .assertIn ('Start date:' , study_start_date )
136
- ##
137
- # To conform to study_start_date format in template. For month
138
- # September (9) we have to do something more.
139
- # TODO: search for better solution
140
- ##
141
- if self .experiment .study .start_date .month == 9 :
142
- strdate = self .experiment .study .start_date .strftime (
143
- "%b. %d, %Y"
144
- ).lstrip ("0" ).replace (". " , "t. " )
145
- else :
146
- strdate = self .experiment .study .start_date .strftime (
147
- "%b. %d, %Y"
148
- ).lstrip ("0" ).replace (" 0" , " " )
149
- self .assertIn (strdate , study_start_date )
136
+ self .assertIn (
137
+ self .experiment .study .start_date .strftime ("%B %d, %Y" ),
138
+ study_start_date
139
+ )
150
140
study_end_date = self .browser .find_element_by_id (
151
141
'study_enddate' ).text
152
142
self .assertIn ('End date:' , study_end_date )
@@ -202,7 +192,8 @@ def test_can_view_detail_page(self):
202
192
# expands displaying textual representation of the experimental
203
193
# protocol.
204
194
group = self .experiment .groups .first ()
205
- link_details = self .browser .find_element_by_link_text ('Details' )
195
+ link_details = self .browser .find_element_by_xpath (
196
+ "//a[@href='#collapse_group" + str (group .id ) + "']" )
206
197
link_details .click ()
207
198
208
199
self .wait_for (lambda : self .assertIn (
@@ -1478,13 +1469,6 @@ def test_clicking_in_download_all_experiment_data_link_pops_up_a_modal_with_lice
1478
1469
# In the modal there is also how to cite that experiment in her own
1479
1470
# work
1480
1471
self .assertIn ('How to cite this experiment:' , license_modal .text )
1481
- ##
1482
- # this is to mimic how datetime is displayed in template by default
1483
- ##
1484
- sent_date = \
1485
- self .experiment .sent_date .strftime ("%b. %d, %Y" ).lstrip ("0" ).replace (
1486
- " 0" , " "
1487
- )
1488
1472
self .assertIn (
1489
1473
'das Dores' .upper () + ', Anibal' , license_modal .text
1490
1474
)
@@ -1495,7 +1479,8 @@ def test_clicking_in_download_all_experiment_data_link_pops_up_a_modal_with_lice
1495
1479
'Farias' .upper () + ', Antônio' , license_modal .text
1496
1480
)
1497
1481
self .assertIn (
1498
- self .experiment .title + '. Sent date: ' + str (sent_date ),
1482
+ self .experiment .title + '. Sent date: ' + str (
1483
+ self .experiment .sent_date .strftime ('%B %d, %Y' )),
1499
1484
license_modal .text
1500
1485
)
1501
1486
self .assertNotIn (
@@ -1532,20 +1517,14 @@ def test_clicking_in_download_all_experiment_data_link_pops_up_a_modal_with_lice
1532
1517
# In the modal there is also how to cite that experiment in her own
1533
1518
# work
1534
1519
self .assertIn ('How to cite this experiment:' , license_modal .text )
1535
- ##
1536
- # this is to mimic how datetime is displayed in template by default
1537
- ##
1538
- sent_date = \
1539
- self .experiment .sent_date .strftime ("%b. %d, %Y" ).lstrip ("0" ).replace (
1540
- " 0" , " " )
1541
-
1542
1520
self .assertIn (
1543
1521
self .experiment .study .researcher .last_name .upper () + ', ' +
1544
1522
self .experiment .study .researcher .first_name ,
1545
1523
license_modal .text
1546
1524
)
1547
1525
self .assertIn (
1548
- self .experiment .title + '. Sent date: ' + str (sent_date ) + '.' ,
1526
+ self .experiment .title + '. Sent date: ' +
1527
+ self .experiment .sent_date .strftime ('%B %d, %Y' ) + '.' ,
1549
1528
license_modal .text
1550
1529
)
1551
1530
@@ -1613,9 +1592,7 @@ def test_how_to_cite_in_license_modal_is_equal_to_how_to_cite_in_citation_file_1
1613
1592
self .assertIn (
1614
1593
'SORIANO, Valdick. ' + self .experiment .title
1615
1594
+ '. Sent date: '
1616
- + str (self .experiment .sent_date .strftime ('%b. %d, %Y' ).lstrip ('0' ).replace (
1617
- ' 0' , ' '
1618
- )),
1595
+ + self .experiment .sent_date .strftime ('%B %d, %Y' ),
1619
1596
license_modal .text
1620
1597
)
1621
1598
@@ -1672,9 +1649,7 @@ def test_how_to_cite_in_license_modal_is_equal_to_how_to_cite_in_citation_file_2
1672
1649
self .assertIn (
1673
1650
'COSTA, Edimilson; ROSS B., Diana; BOULOS, Guilherme. '
1674
1651
+ self .experiment .title + '. Sent date: '
1675
- + str (self .experiment .sent_date .strftime ('%b. %d, %Y' ).lstrip ('0' ).replace (
1676
- ' 0' , ' '
1677
- )),
1652
+ + self .experiment .sent_date .strftime ('%B %d, %Y' ),
1678
1653
license_modal .text
1679
1654
)
1680
1655
0 commit comments