Closed PantelisElinas closed 4 years ago
Update: The problem seems to be when log in from the browser it is using the production database. The users we create in the selenium tests, subclassed from django.test.TestCase or django.contrib.staticfiles.testing.StaticLiveServerTestCase are stored in their own database which has the lifecycle as the tests themselves.
I have verified this by creating a user with the same credential in the production database as the ones created in the tests, and I was able to log in.
Update: Turns out the problem was with the port number I was using which differs from the port the test database was using.
When running all the tests, Selenium and Django together using the command,
python manage.py test catalog.tests
cause the Selenium tests to fail with a user login error (even though the Django tests run without problems)
The Selenium tests run correctly if invoked separately using the command,
python manage.py test catalog.tests.test_selenium_flaggingcomments
@Zhenghao-Zhao wrote about this issue,
This ticket is about getting around the above problem by separating the Selenium and Django tests into separate folders so that we can run them separately.