Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserListTest sometimes throws error #175

Closed
oliverroick opened this issue May 2, 2016 · 8 comments
Closed

UserListTest sometimes throws error #175

oliverroick opened this issue May 2, 2016 · 8 comments
Assignees
Labels

Comments

@oliverroick
Copy link
Member

oliverroick commented May 2, 2016

This happens only once in a while, need to investigate

_______________________________________________________________________ UserListTest.test_get_with_user _______________________________________________________________________

self = <organization.tests.test_views_default_users.UserListTest testMethod=test_get_with_user>

    def test_get_with_user(self):
        assign_user_policies(self.user, self.policy)
        response = self.view(self.request).render()
        content = response.content.decode('utf-8')

        dummy = default.UserList()
        dummy.object_list = self.users
        dummy.get_context_data()
        expected = render_to_string(
            'organization/user_list.html',
            {'object_list': self.users, 'user': self.request.user},
            request=self.request)

        assert response.status_code == 200
>       assert expected == content
E       AssertionError: assert '\n\n\n\n\n\n...y>\n</html>\n' == '\n\n\n\n\n\n<...y>\n</html>\n'
E         Skipping 2280 identical leading characters in diff, use -v to show
E         Skipping 3238 identical trailing characters in diff, use -v to show
E         - >testuser438</td>
E         ?           ^^
E         + >testuser441</td>
E         ?           ^^
E         +     <td>[email protected]</td>
E         +     <td>&mdash;</td>
E         +     <td>&mdash;</td>
E         Detailed information truncated (70 more lines), use "-vv" to show

organization/tests/test_views_default_users.py:64: AssertionError
@oliverroick oliverroick self-assigned this May 2, 2016
@oliverroick oliverroick added the bug label May 2, 2016
@ian-ross
Copy link
Contributor

ian-ross commented May 2, 2016

This is weird. Can't reproduce it with py.test. I've seen it once on Travis. I'm wondering if it's something to do with ordering of the user list. Maybe making https://github.com/Cadasta/cadasta-platform/blob/master/cadasta/organization/tests/test_views_default_users.py#L56 say

dummy.object_list = sorted(self.users)

might help?

I'm trying repeatedly runing the unit tests with tox to see if it's reproducible that way. If it is, I'll try fixing it.

oliverroick added a commit that referenced this issue Jun 3, 2016
ian-ross added a commit that referenced this issue Jun 5, 2016
Fix #175 -- Removes dependency on code from inside the view and ensur…
@seav
Copy link
Contributor

seav commented Jun 29, 2016

This test error apparently still occurs once in a while:
https://travis-ci.org/Cadasta/cadasta-platform/jobs/140818066

@seav seav reopened this Jun 29, 2016
@seav
Copy link
Contributor

seav commented Jul 1, 2016

@clash99
Copy link
Contributor

clash99 commented Jul 7, 2016

I've gotten this twice today. This is the latest: https://travis-ci.org/Cadasta/cadasta-platform/jobs/143129303

@clash99
Copy link
Contributor

clash99 commented Jul 8, 2016

@ian-ross ian-ross closed this as completed Jul 8, 2016
@clash99
Copy link
Contributor

clash99 commented Jul 8, 2016

Is this one fixed? I just got the same sort of error: https://travis-ci.org/Cadasta/cadasta-platform/jobs/143390647

Its not always on the UserList page, but its the same error. This one is faulting OrganizationMembersEditTest.

@ian-ross
Copy link
Contributor

ian-ross commented Jul 8, 2016

It will be fixed when I finish the PR I'm working on. I figured out what was causing it, but this PR is a bit complicated and broke a bunch of functional tests, so it's going to take me a little while to get it ready for merging.

@clash99
Copy link
Contributor

clash99 commented Jul 8, 2016

That's great news! (I mean the fix, not your broken tests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants