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

Add last_active_at column to users page #191

Merged
merged 2 commits into from
Aug 17, 2017

Conversation

alison985
Copy link

@alison985 alison985 requested a review from washort August 12, 2017 01:22
@alison985 alison985 added this to the 9 milestone Aug 12, 2017
@alison985
Copy link
Author

@washort This works in the UI, but the following test passes and I'm not sure how to fix it:

======================================================================
FAIL: test_get_query (tests.handlers.test_queries.TestQueryResourceGet)

Traceback (most recent call last):
File "/app/tests/handlers/test_queries.py", line 17, in test_get_query
self.assertResponseEqual(expected, rv.json)
File "/app/tests/init.py", line 115, in assertResponseEqual
self.assertResponseEqual(v, actual[k])
File "/app/tests/init.py", line 118, in assertResponseEqual
self.assertEqual(v, actual[k], "{} not equal (expected: {}, actual: {}).".format(k, v, actual[k]))
AssertionError: last_active_at not equal (expected: SELECT events.created_at AS events_created_at
FROM events
WHERE events.user_id = %(user_id_1)s ORDER BY events.created_at DESC
LIMIT %(param_1)s, actual: []).

@washort
Copy link

washort commented Aug 14, 2017

The error is because last_active_at is being set to a query object and the response handler is converting it to a list. Since you expect at most one result, I'd call .first() on that query and adjust the template to only expect a single value.

@alison985
Copy link
Author

@washort Thanks. Updated.

@washort
Copy link

washort commented Aug 16, 2017

r+

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

Successfully merging this pull request may close these issues.

2 participants