Browse Source

fixed tests; added new requirement; added migration

Dimitri Korsch 3 years ago
parent
commit
b394a71090
3 changed files with 40 additions and 0 deletions
  1. 36 0
      migrations/versions/8f2554c45633_.py
  2. 1 0
      requirements.txt
  3. 3 0
      tests/client/file_tests.py

+ 36 - 0
migrations/versions/8f2554c45633_.py

@@ -0,0 +1,36 @@
+"""empty message
+
+Revision ID: 8f2554c45633
+Revises: b03df3e31b8d
+Create Date: 2022-02-09 13:55:07.389805
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = '8f2554c45633'
+down_revision = 'b03df3e31b8d'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.create_table('result_confirmation',
+    sa.Column('id', sa.Integer(), nullable=False),
+    sa.Column('result_id', sa.Integer(), nullable=False),
+    sa.Column('confirming_user', sa.String(), nullable=False),
+    sa.ForeignKeyConstraint(['result_id'], ['result.id'], ondelete='CASCADE'),
+    sa.PrimaryKeyConstraint('id')
+    )
+    op.add_column('result', sa.Column('origin_user', sa.String(), nullable=True))
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.drop_column('result', 'origin_user')
+    op.drop_table('result_confirmation')
+    # ### end Alembic commands ###

+ 1 - 0
requirements.txt

@@ -8,6 +8,7 @@ flask-socketio
 flask-sqlalchemy
 sqlalchemy_serializer
 flask-migrate
+flask-htpasswd
 python-socketio
 munch
 scikit-image

+ 3 - 0
tests/client/file_tests.py

@@ -217,6 +217,7 @@ class FileGettingTests(_BaseFileTests):
             self.assertTrue(response.is_json)
 
             content_should = dict(
+                current=file.serialize(),
                 next=n_file,
                 nextInCollection=n_file,
                 previous=p_file,
@@ -234,6 +235,7 @@ class FileGettingTests(_BaseFileTests):
         self.assertTrue(response.is_json)
 
         content_should = dict(
+            current=file.serialize(),
             next=n_file.serialize(),
             nextInCollection=n_file.serialize(),
             previous=p_file.serialize(),
@@ -251,6 +253,7 @@ class FileGettingTests(_BaseFileTests):
         self.assertTrue(response.is_json)
 
         content_should = dict(
+            current=file.serialize(),
             next=n_file.serialize(),
             nextInCollection=n_file.serialize(),
             previous=p_file.serialize(),