File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
sms_survey/engagement/templates Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -136,4 +136,9 @@ Run Functional Test(Failing)
136136Let's code some html, currently it's looking for header.
137137
138138
139- Now we are coding for the next page with url "/send_sms/"
139+ Now we are coding for the next page with url "/send_sms/"
140+
141+ Now we are done with coding the send_sms page with form.
142+
143+ Let's go to the view function for send_sms, it's time for unit test.
144+
Original file line number Diff line number Diff line change @@ -57,11 +57,10 @@ def test_can_view_the_page(self):
5757 # Lastly a button to submit the form.
5858 send_sms_button = self .browser .find_element_by_id ('id_send_sms' )
5959 self .assertEqual (
60- send_sms_button .get_attribute ( 'value' ) ,
60+ send_sms_button .text ,
6161 "Send SMS"
6262 )
6363
64-
6564 # So he add his contact number on the first field. 09152087801
6665 input_contact .send_keys ("09152087801" )
6766
@@ -77,6 +76,8 @@ def test_can_view_the_page(self):
7776 # With a notification that says, "Message sent, please wait for reply!"
7877 message_notification = self .browser .find_element_by_css_selector ('.messages li:first-child' ).text ()
7978
79+ self .assertEqual (self .browser .current_url , "http://localhost:8000/" )
80+
8081 # He still didn't see any reply.
8182 table_replies = self .browser .find_element_by_id ("id_table_replies" )
8283 rows = table_replies .find_element_by_tag_name ("tr" )
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > Send SMS</ title >
5+ </ head >
6+ < body >
7+ < header > Fill this information to send an SMS</ header >
8+
9+ < form method ="POST ">
10+ {% csrf_token %}
11+ < input type ="text " id ="id_contact " name ="contact " placeholder ="Enter phone number " />
12+ < textarea id ="id_message " name ="message " placeholder ="Enter your message "> </ textarea >
13+ < button type ="submit " id ="id_send_sms "> Send SMS</ button >
14+ </ form >
15+ </ body >
16+ </ html >
You can’t perform that action at this time.
0 commit comments