Ejemplo n.º 1
0
 def test_search_user_by_name(self):
     form_data = {'name': 'Hardy'}
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url, '/users/search/Hardy/')
Ejemplo n.º 2
0
 def test_search_user_by_alternate_email(self):
     form_data = {'email': self.user_2_alternate_email}
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url,
                     '/users/{}/'.format(self.user_2.guids.first()._id))
Ejemplo n.º 3
0
 def test_search_user_by_alternate_email(self):
     form_data = {
         'email': self.user_2_alternate_email
     }
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url, '/users/{}/'.format(self.user_2.guids.first()._id))
Ejemplo n.º 4
0
 def test_search_user_by_name_with_punctuation(self):
     form_data = {
         'name': '~Dr. Sportello-Fay, PI'
     }
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url, furl.quote('/users/search/~Dr. Sportello-Fay, PI/', safe='/.,~'))
Ejemplo n.º 5
0
 def test_search_user_by_name(self):
     form_data = {
         'name': 'Hardy'
     }
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url, '/users/search/Hardy/')
Ejemplo n.º 6
0
 def test_search_user_by_name_with_punctuation(self):
     form_data = {
         'name': 'Dr. Sportello-Fay, PI @, #, $, %, ^, &, *, (, ), ~'
     }
     form = UserSearchForm(data=form_data)
     nt.assert_true(form.is_valid())
     response = self.view.form_valid(form)
     nt.assert_equal(response.status_code, 302)
     nt.assert_equal(self.view.success_url, '/users/search/Dr.%20Sportello-Fay,%20PI%20@,%20%23,%20$,%20%25,%20%5E,%20&,%20*,%20(,%20),%20~/')