def test_get_contributors_from_parent(self):
     self.project.add_contributor(
         AuthUserFactory(),
         auth=self.auth,
         visible=True,
     )
     self.project.add_contributor(
         AuthUserFactory(),
         auth=self.auth,
         visible=False,
     )
     self.project.save()
     component = NodeFactory(parent=self.project, creator=self.user)
     url = component.api_url_for('get_contributors_from_parent')
     res = self.app.get(url, auth=self.user.auth)
     # Should be all contributors, client-side handles marking
     # contributors that are already added to the child.
     assert_equal(
         len(res.json['contributors']),
         2,
     )
Ejemplo n.º 2
0
 def test_get_contributors_from_parent(self):
     self.project.add_contributor(
         AuthUserFactory(),
         auth=self.auth,
         visible=True,
     )
     self.project.add_contributor(
         AuthUserFactory(),
         auth=self.auth,
         visible=False,
     )
     self.project.save()
     component = NodeFactory(parent=self.project, creator=self.user)
     url = component.api_url_for('get_contributors_from_parent')
     res = self.app.get(url, auth=self.user.auth)
     # Should be all contributors, client-side handles marking
     # contributors that are already added to the child.
     assert_equal(
         len(res.json['contributors']),
         2,
     )