Exemple #1
0
 def test_set_data_on_form(self):
     form = LoginForm('test')
     post_data = {
         'username': '******',
         'password': '******',
         'first_name': None,
         'last_name': None,
         'email': None}
     form.data = post_data
     assert form.data == post_data
     environ = environ_with_file()
     request = Request.from_environ(environ)
     form.data = request
     assert form.data['first_name'] == '1234'
 def test_set_data_from_request_with_file(self):
     request = Request.from_environ(
         environ_with_file(), 'watson.http.sessions.Memory')
     form = self.protected_form('test', session=request.session)
     form.data = request
     assert form.data['test'] == 'blah'