summaryrefslogtreecommitdiffstats
path: root/tests/test_fixtures.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-04-23 17:36:22 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-04-23 17:36:22 -0700
commit5416a2570e7167ca2e62352dda10d2f371b994a7 (patch)
tree02439733d6b74dc6e83aaa49a314b49c5ece5a67 /tests/test_fixtures.py
parent5bdd3f6e871599acb339aadc9b78cc12860f9759 (diff)
downloadfatcat-5416a2570e7167ca2e62352dda10d2f371b994a7.tar.gz
fatcat-5416a2570e7167ca2e62352dda10d2f371b994a7.zip
start work on api client
Diffstat (limited to 'tests/test_fixtures.py')
-rw-r--r--tests/test_fixtures.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py
new file mode 100644
index 00000000..2ced3bb5
--- /dev/null
+++ b/tests/test_fixtures.py
@@ -0,0 +1,29 @@
+
+import pytest
+import fatcat.api_client
+from fixtures import *
+
+
+def test_rich_app_fixture(rich_app):
+ app = rich_app
+
+ assert ChangelogEntry.query.count() == 1
+
+ for cls in (WorkIdent, WorkRev, WorkEdit,
+ ContainerIdent, ContainerRev, ContainerEdit,
+ CreatorIdent, CreatorRev, CreatorEdit,
+ FileIdent, FileRev, FileEdit):
+ assert cls.query.count() == 1
+ for cls in (ReleaseIdent, ReleaseRev, ReleaseEdit):
+ assert cls.query.count() == 2
+
+ for cls in (WorkIdent,
+ ContainerIdent,
+ CreatorIdent,
+ FileIdent):
+ assert cls.query.filter(cls.is_live==True).count() == 1
+ assert ReleaseIdent.query.filter(ReleaseIdent.is_live==True).count() == 2
+
+ # test that editor's active edit group is now invalid
+ editor = Editor.query.first()
+ assert editor.active_edit_group == None