opened
wagnerdelima
username_0
After running test test_register_and_login, it always outputs ERROR or FAIL to me. It seams it not registering the user.
test_register_and_login not working
issue
created
miguelgrinberg
username_1
Can you paste the output from the test suite please?
comment
created
wagnerdelima
username_0
Sure, first of all in line self.assertTrue(response.status_code == 302). response.status_code does not have a 302 code, but 200. It fails there. So, I changed to 200 in assertion and it passes. Although, all code keeps failing and the output is as follows:

test_register_and_login (test_client.FlaskClientTestCase) ... FAIL

======================================================================
FAIL: test_register_and_login (test_client.FlaskClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wagner/workspace-trabalho/sweety.dashboard/tests/test_client.py", line 54, in test_register_and_login
    self.assertTrue(re.search('Hello,\s+waglds!', data))
AssertionError: None is not true

----------------------------------------------------------------------
comment
created
miguelgrinberg
username_1
It looks like you have changed the tests, you are not running the original code, correct? When I look in line 54 of test_client.py I don't see the assert statement that your error shows.

I recommend that you print the `data` variable right before the assertion, to see what it contains. That will help you figure out where the problem is.
comment
closed
miguelgrinberg
username_1
issue