xform share api endpoint

It will fail, but it shouldn't. It's a valid use case to test changing an
role from owner to editor.

I agree it should be a specific order but it must test for the above case
(change from more to fewer permissions).
On Jun 13, 2014 2:14 PM, "ukanga" <notifications@github.com> wrote:

> In onadata/apps/api/tests/viewsets/test_xform_viewset.py:
>
> > @@ -371,3 +371,25 @@ def test_form_delete(self):
> >          self.assertEqual(response.status_code, 204)
> >          with self.assertRaises(XForm.DoesNotExist):
> >              self.xform.reload()
> > +
> > +    def test_form_share_endpoint(self):
> > +        self._publish_xls_form_to_project()
> > +        alice_data = {'username': 'alice', 'email': 'alice@localhost.com'}
> > +        alice_profile = self._create_user_profile(alice_data)
> > +
> > +        view = XFormViewSet.as_view({
> > +            'post': 'share'
> > +        })
> > +        formid = self.xform.pk
> > +
> > +        for role, role_class in ROLES.items():
>
> With this I would really want to follow a specific order, ideally starting
> from readonly to owner being last. Otherwise it will always fail when the
> previous permission was of a superset of the current one.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/onaio/onadata/pull/328/files#r13764254>.
>