Closed timlinux closed 10 years ago
One of the failing test is because it needs to send email and I don't specify the username and password for SMTP. How do we ignore it?
On Fri, Nov 8, 2013 at 5:18 AM, Tim Sutton notifications@github.com wrote:
Problem
Some tests are failing and pylint and pep8 checks are failing
See http://jenkins.linfiniti.com/job/UserMap/86/ Proposed solution
- Akbar can you take a look at the issues listed in the link above?
Expected outcome
Jenkins should show a lovely blue dot with no thunderclouds next to the user map :-)
— Reply to this email directly or view it on GitHubhttps://github.com/timlinux/user_map/issues/17 .
Akbar Gumbira Teknik Informatika Institut Teknologi Bandung 2008
Hi
On Fri, Nov 8, 2013 at 4:01 PM, Akbar Gumbira notifications@github.comwrote:
One of the failing test is because it needs to send email and I don't specify the username and password for SMTP. How do we ignore it?
Typically you would use a mock object for this kind of test - replacing https://github.com/timlinux/user_map/blob/master/users/utilities/helpers.py#L28with a mock function that e.g. writes the email to a text file on disk or to console. See e.g.
https://docs.djangoproject.com/en/dev/topics/email/#console-backend
Regards
Tim
On Fri, Nov 8, 2013 at 5:18 AM, Tim Sutton notifications@github.com wrote:
Problem
Some tests are failing and pylint and pep8 checks are failing
See http://jenkins.linfiniti.com/job/UserMap/86/ Proposed solution
- Akbar can you take a look at the issues listed in the link above?
Expected outcome
Jenkins should show a lovely blue dot with no thunderclouds next to the user map :-)
— Reply to this email directly or view it on GitHub< https://github.com/timlinux/user_map/issues/17> .
Akbar Gumbira Teknik Informatika Institut Teknologi Bandung 2008
— Reply to this email directly or view it on GitHubhttps://github.com/timlinux/user_map/issues/17#issuecomment-28064277 .
Visit http://linfiniti.com to find out about:
A better solution would be to use flask-email which has infrastructure for testing :
http://pythonhosted.org/Flask-Mail/#unit-tests-and-suppressing-emails
And then use the record_messages function to check if your tests sent the mail properly.
Regards
Tim
All tests are passing now and we have a nice bright sun
Problem
Some tests are failing and pylint and pep8 checks are failing
See http://jenkins.linfiniti.com/job/UserMap/86/
Proposed solution
Expected outcome
Jenkins should show a lovely blue dot with no thunderclouds next to the user map :-)