Browse Source

Uses BeautifulSoup with an explicit HTML parser

Adrien Panay 7 years ago
parent
commit
b5e8150dd0

+ 1 - 1
install/requirements.txt View File

17
 alembic==0.8.4
17
 alembic==0.8.4
18
 argparse==1.2.1
18
 argparse==1.2.1
19
 backlash==0.0.7
19
 backlash==0.0.7
20
-beautifulsoup4==4.4.0
20
+beautifulsoup4==4.6.0
21
 caldav==0.4.0
21
 caldav==0.4.0
22
 cliff==2.9.1
22
 cliff==2.9.1
23
 cmd2==0.6.9
23
 cmd2==0.6.9

+ 3 - 3
tracim/tracim/tests/functional/test_ldap_restrictions.py View File

26
         home = self.app.get('/home/',)
26
         home = self.app.get('/home/',)
27
 
27
 
28
         # HTML button is not here
28
         # HTML button is not here
29
-        eq_(None, BeautifulSoup(home.body).find(attrs={'class': 'change-password-btn'}))
29
+        eq_(None, BeautifulSoup(home.body, 'html.parser').find(attrs={'class': 'change-password-btn'}))
30
 
30
 
31
         # If we force passwd update, we got 403
31
         # If we force passwd update, we got 403
32
         try_post_passwd = self.app.post(
32
         try_post_passwd = self.app.post(
51
         edit = self.app.get('/user/5/edit')
51
         edit = self.app.get('/user/5/edit')
52
 
52
 
53
         # email input field is disabled
53
         # email input field is disabled
54
-        email_input = BeautifulSoup(edit.body).find(attrs={'id': 'email'})
54
+        email_input = BeautifulSoup(edit.body, 'html.parser').find(attrs={'id': 'email'})
55
         ok_('readonly' in email_input.attrs)
55
         ok_('readonly' in email_input.attrs)
56
         eq_(email_input.attrs['readonly'], "readonly")
56
         eq_(email_input.attrs['readonly'], "readonly")
57
 
57
 
58
         # Name is not (see attributes configuration of LDAP fixtures)
58
         # Name is not (see attributes configuration of LDAP fixtures)
59
-        name_input = BeautifulSoup(edit.body).find(attrs={'id': 'name'})
59
+        name_input = BeautifulSoup(edit.body, 'html.parser').find(attrs={'id': 'name'})
60
         ok_('readonly' not in name_input.attrs)
60
         ok_('readonly' not in name_input.attrs)
61
 
61
 
62
         # If we force edit of user, "email" field will be not updated
62
         # If we force edit of user, "email" field will be not updated

+ 1 - 1
tracim/tracim/tests/functional/test_root.py View File

30
         msg = 'copyright © 2013 - {} tracim project.'.format(h.current_year())
30
         msg = 'copyright © 2013 - {} tracim project.'.format(h.current_year())
31
         ok_(msg in response)
31
         ok_(msg in response)
32
 
32
 
33
-        forms = BeautifulSoup(response.body).find_all('form')
33
+        forms = BeautifulSoup(response.body, 'html.parser').find_all('form')
34
         print('FORMS = ',forms)
34
         print('FORMS = ',forms)
35
         eq_(1, len(forms))
35
         eq_(1, len(forms))
36
         eq_('w-login-form', forms[0].get('id'))
36
         eq_('w-login-form', forms[0].get('id'))