diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 13:59:48 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 13:59:53 -0700 |
commit | 35b2d8a7589906f699c75bc52242bf362d37e427 (patch) | |
tree | 357ce2b42ed7d3f3a0e09abd1f92e5e74b7d795f /tests/test_backend.py | |
parent | 49dc8c327da6615de5179f4d50a05b61861448e8 (diff) | |
download | fatcat-35b2d8a7589906f699c75bc52242bf362d37e427.tar.gz fatcat-35b2d8a7589906f699c75bc52242bf362d37e427.zip |
basic edit group approval
Diffstat (limited to 'tests/test_backend.py')
-rw-r--r-- | tests/test_backend.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/test_backend.py b/tests/test_backend.py index 4bf0224d..373cceb9 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -182,7 +182,7 @@ class APITestCase(FatcatTestCase): # not alive yet assert WorkIdent.query.filter(WorkIdent.is_live==True).count() == 0 - def test_api_complete_create(self): + def test_api_rich_create(self): # TODO: create user? @@ -240,6 +240,7 @@ class APITestCase(FatcatTestCase): data=json.dumps(dict( title="dummy work", work_type="book", + # XXX: #work=work_id, #container=container_id, #creators=[creator_id], @@ -271,12 +272,18 @@ class APITestCase(FatcatTestCase): ReleaseIdent, ReleaseRev, ReleaseEdit, FileIdent, FileRev, FileEdit): assert cls.query.count() == 1 - # Ident only: assert cls.query.filter(is_live=True).count() == 1 + + for cls in (WorkIdent, + ContainerIdent, + CreatorIdent, + ReleaseIdent, + FileIdent): + assert cls.query.filter(cls.is_live==True).count() == 0 rv = self.app.post('/v0/editgroup/{}/accept'.format(editgroup_id), headers={"content-type": "application/json"}) - # XXX: assert rv.status_code == 200 - # XXX: assert ChangelogEntry.query.count() == 1 + assert rv.status_code == 200 + assert ChangelogEntry.query.count() == 1 for cls in (WorkIdent, WorkRev, WorkEdit, ContainerIdent, ContainerRev, ContainerEdit, @@ -284,4 +291,12 @@ class APITestCase(FatcatTestCase): ReleaseIdent, ReleaseRev, ReleaseEdit, FileIdent, FileRev, FileEdit): assert cls.query.count() == 1 - # Ident only: assert cls.query.filter(is_live=True).count() == 1 + + for cls in (WorkIdent, + ContainerIdent, + CreatorIdent, + ReleaseIdent, + FileIdent): + assert cls.query.filter(cls.is_live==True).count() == 1 + + # XXX: re-fetch and test that relations work |