On 06/19/2016 01:19 PM, Finucane, Stephen wrote:
On 16 Jun 16:13, Andy Doan wrote:
This exposes patches via the REST API.
Security Constraints:
* Anyone (logged in or not) can read all objects.
* No one can create/delete objects.
* Project maintainers are allowed to update (ie "patch"
attributes)
NOTE: Patch.save was overridden incorrectly and had to be
fixed to work with DRF.
Signed-off-by: Andy Doan <[email protected]>
There's an issue with one of the tests below when I run the entire
test suite as one...
+ def test_detail_tags(self):
+ patches = create_patches()
+ patches[0].content = 'Reviewed-by: Test User <[email protected]>\n'
+ patches[0].save()
+ patches[0].refresh_tag_counts()
^ I don't think this is needed (it's called in 'save'), but more
importantly...
good catch.
+ resp = self.client.get(self.api_url(patches[0].id))
+ tags = resp.data['tags']
+ self.assertEqual(1, len(tags))
The above assertion fails when I run the entire test suite, like so:
tox -e py27
This doesn't seem to be storing tags correctly.
======================================================================
FAIL: test_detail_tags (patchwork.tests.test_rest_api.TestPatchAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/sfinucan/innovation/patchwork/patchwork/patchwork/tests/test_rest_api.py",
line 274, in test_detail_tags
self.assertEqual(1, len(tags))
AssertionError: 1 != 0
I'm guessing it's due to some side effect, but I haven't figured out
what's causing this yet. Mind taking a look?
It seems like the "fixtures" attribute for the test:
fixtures = ['default_states', 'default_tags']
is getting ignored under certain circumstances. ie - I added some
debugging[1] and see no configured tags for the project when I run the
full suite, but see the expected ones when I just run test_rest_api. I
haven't used fixtures in django before, but will poke around.
1: http://paste.ubuntu.com/17618580/
_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork