Example #1
0
 def test_true_for_successful_lookup(self):
     uri = '/some/object/'
     lookup = {'user_uuid': 'user-uuid'}
     result = user_owns_resource(uri, lookup)
     eq_(result, True)
     self.solitude.by_url.assert_called_with(uri)
     self.getter.assert_called_with(**lookup)
Example #2
0
 def test_false_for_failed_lookup(self):
     self.getter.side_effect = ObjectDoesNotExist
     result = user_owns_resource(
         '/some/object/', {'user_uuid': 'user-uuid'}
     )
     eq_(result, False)