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 extras fields to discussion #1360

Merged
merged 2 commits into from Jan 13, 2018

Conversation

l-vincent-l
Copy link
Contributor

We need it for transport.data.gouv.fr
It'll be only accessible through API for now

fix #1359

@taniki taniki requested review from a team and taniki January 10, 2018 17:08
Copy link
Contributor

@noirbizarre noirbizarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, but the test method needs to be renamed

@@ -100,6 +100,44 @@ def test_new_discussion_missing_subject(self):
})
self.assertStatus(response, 400)

def test_new_discussion(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function must be renamed (test_new_discussion_with_extras ?) because it's already used (and so one of the test is hiding the other)

@@ -100,6 +100,44 @@ def test_new_discussion_missing_subject(self):
})
self.assertStatus(response, 400)

def test_new_discussion(self):
self.app.config['USE_METRICS'] = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you're only testing the extras part, I think you can safely remove everything related to metrics

self.assert201(response)

dataset.reload()
self.assertEqual(dataset.metrics['discussions'], 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 lines too (metrics related, can be removed)

Copy link
Contributor

@abulte abulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the entry in CHANGELOG.

@l-vincent-l l-vincent-l force-pushed the add_discussions_extras branch 2 times, most recently from 75ff993 to 8e15d01 Compare January 11, 2018 11:09
@l-vincent-l
Copy link
Contributor Author

Done.

self.assertEqual(discussion.user, user)
self.assertEqual(len(discussion.discussion), 1)
self.assertIsNotNone(discussion.created)
self.assertIsNone(discussion.closed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it important to check that discussion.created and discussion.closed aren't in the discussion ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a copy/paste from the add_new_discussion test.
It could be deleted.

We need it for transport.data.gouv.fr
It'll be only accessible through API for now
@bonjourmauko
Copy link

What can we do for this PR to be merged? I see there's already a consensus.

@abulte
Copy link
Contributor

abulte commented Jan 13, 2018

I’ll merge it. Forgot that @l-vincent-l probably does not have the permission to do so.

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

Successfully merging this pull request may close these issues.

I need to add more information on discussions
6 participants