#1707 Do no convert milestones and properties if not needed and fix running the tests
Merged by pingou. Opened by pingou.
milestones  into  master

Download 1707.patch

The two commits of that PR can be considered as single units.
The first one stop converting the milestones and properties to string while it's not needed
and the second fix running the unit-tests without a local smtp server.

I should add unit-tests for the first of these commits, give me a few

2 new commits added

  • Small formatting fix (indentation and empty line)
  • Add unit-tests checking the behavior of view_issue when non-ascii milestone

Can this please be broken into two tests?

Just so you know, if you don't need access to the mock object you can do

@patch('pagure.lib.notify.smtplib.SMTP', Mock(return_value=MagicMock()))
def test_get_emails_for_obj_pr(self):

Oh, I see you already know this from above :smile:

Is there an issue associated with this?

For the first commit yes: https://pagure.io/pagure/issue/1699 for the others no tickets

Does it really matter? I thought what matter is that there is a test

Yes, if you want it to be maintainable and inviting for others to use. This function is ~150 lines and is titled test_view_issue. It's hard to review and difficult to adjust. I have no idea what cases it covers, and will have to read it all to find out, keeping in mind that often state is shared between sections.

There should be a TestCase class for each scenario (that is, this entire function should likely be a class). Each function should cover a single aspect of that scenario.

rebased

rebased

rebased

Rebased :)

Looks fine to me, merge on :thumbsup:

Pull-Request has been merged by pingou

Metadata