summaryrefslogtreecommitdiffstats
path: root/python/tests/test_fixtures.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-16 18:34:19 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-16 18:34:19 -0700
commit4cf667c283d54f769e73d76bb23bbb68b4329cf8 (patch)
tree4bbeb1cdeb053c09e86e2cc41962382bcb837729 /python/tests/test_fixtures.py
parentb2d5968e0a7ac5576782f54980c930345f4c5298 (diff)
downloadfatcat-4cf667c283d54f769e73d76bb23bbb68b4329cf8.tar.gz
fatcat-4cf667c283d54f769e73d76bb23bbb68b4329cf8.zip
move python code to subdirectory
Diffstat (limited to 'python/tests/test_fixtures.py')
-rw-r--r--python/tests/test_fixtures.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/python/tests/test_fixtures.py b/python/tests/test_fixtures.py
new file mode 100644
index 00000000..0a0d3176
--- /dev/null
+++ b/python/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_editgroup == None