From 3aaaa90c6a34797c1767b80567ce12a87ba39313 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E9=A3=9E?= <2624970078@qq.com>
Date: Fri, 4 Jun 2021 12:22:53 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9app\test\test=5Flogin.py?=
 =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8B=A5=E5=B9=B2=E4=BB=A3=E7=A0=81=EF=BC=8C?=
 =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E6=98=AF=E5=90=A6=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/test/test_login.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/app/test/test_login.py b/app/test/test_login.py
index 9fa3ae8..1549936 100644
--- a/app/test/test_login.py
+++ b/app/test/test_login.py
@@ -59,5 +59,19 @@ def test_login():
     
         driver.save_screenshot('./app/test/test_login_pic4.png')    
         assert 'EnglishPal Study Room for ' + uname in  driver.title
+
+        # 测试bug是否修复
+        driver.get(HOME_PAGE)
+        elem = driver.find_element_by_link_text('登录')
+        elem.click()
+        uname = 'lanhui'
+        elem = driver.find_element_by_name('username')
+        elem.send_keys(uname)
+        elem = driver.find_element_by_name('password')
+        elem.send_keys("' or 'a'='a'or'a'='a")
+        elem = driver.find_element_by_xpath('//form[1]/p[3]/input[1]') # 找到登录按钮
+        elem.click()
+        driver.save_screenshot('./app/test/test_login_pic5.png')
+        assert '无法通过验证。' in driver.page_source
     finally:
         driver.quit()