Skip to content

Commit

Permalink
Fix merge conflict in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel committed Apr 29, 2019
1 parent d9bca08 commit e59584b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-28 13:24
# Generated by Django 1.11.20 on 2019-04-29 09:10
from __future__ import unicode_literals

from django.db import migrations, models
import localized_fields.fields.field
import localized_fields.fields.text_field


class Migration(migrations.Migration):

dependencies = [("form", "0012_auto_20190416_1835")]
dependencies = [("form", "0013_auto_20190418_0733")]

operations = [
migrations.AddField(
model_name="question",
name="static_content",
field=localized_fields.fields.field.LocalizedField(
field=localized_fields.fields.text_field.LocalizedTextField(
blank=True, null=True, required=[]
),
),
Expand All @@ -33,9 +33,11 @@ class Migration(migrations.Migration):
("table", "table"),
("form", "form"),
("file", "file"),
("dynamic_choice", "dynamic_choice"),
("dynamic_multiple_choice", "dynamic_multiple_choice"),
("static", "static"),
],
max_length=15,
max_length=23,
),
),
]
4 changes: 2 additions & 2 deletions caluma/form/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.db import models, transaction
from django.db.models.signals import post_init
from django.dispatch import receiver
from localized_fields.fields import LocalizedField
from localized_fields.fields import LocalizedField, LocalizedTextField

from ..core.models import SlugModel, UUIDModel
from .storage_clients import client
Expand Down Expand Up @@ -75,7 +75,7 @@ class Question(SlugModel):
is_archived = models.BooleanField(default=False)
placeholder = LocalizedField(blank=True, null=True, required=False)
info_text = LocalizedField(blank=True, null=True, required=False)
static_content = LocalizedField(blank=True, null=True, required=False)
static_content = LocalizedTextField(blank=True, null=True, required=False)
configuration = JSONField(default=dict)
meta = JSONField(default=dict)
data_source = models.CharField(max_length=255, blank=True, null=True)
Expand Down
1 change: 1 addition & 0 deletions caluma/form/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class Meta:
"row_form",
"sub_form",
"placeholder",
"static_content",
)
use_connection = False
interfaces = (Question, graphene.Node)
Expand Down
33 changes: 17 additions & 16 deletions caluma/form/tests/snapshots/snap_test_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from snapshottest import Snapshot


snapshots = Snapshot()

snapshots["test_save_question[true-True-SaveTextQuestion] 1"] = {
Expand Down Expand Up @@ -606,7 +607,22 @@
}
}

snapshots["test_query_all_questions[static-question__configuration10] 1"] = {
snapshots["test_save_static_question[static] 1"] = {
"saveStaticQuestion": {
"clientMutationId": "testid",
"question": {
"__typename": "StaticQuestion",
"id": "U3RhdGljUXVlc3Rpb246ZWZmb3J0LW1lZXQ=",
"label": "Brian Williams",
"meta": {},
"slug": "effort-meet",
"staticContent": """Line whatever team suggest traditional boy. Drop argue move. Anyone remember prove.
Kid avoid player relationship to range whose. Draw free property consider.""",
},
}
}

snapshots["test_query_all_questions[static-question__configuration12] 1"] = {
"allQuestions": {
"edges": [
{
Expand All @@ -624,18 +640,3 @@
]
}
}

snapshots["test_save_static_question[static] 1"] = {
"saveStaticQuestion": {
"clientMutationId": "testid",
"question": {
"__typename": "StaticQuestion",
"id": "U3RhdGljUXVlc3Rpb246ZWZmb3J0LW1lZXQ=",
"label": "Brian Williams",
"meta": {},
"slug": "effort-meet",
"staticContent": """Line whatever team suggest traditional boy. Drop argue move. Anyone remember prove.
Kid avoid player relationship to range whose. Draw free property consider.""",
},
}
}
2 changes: 1 addition & 1 deletion caluma/form/tests/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def test_complex_document_query_performance(
}
"""

with django_assert_num_queries(11):
with django_assert_num_queries(12):
result = schema_executor(query, variables={"id": str(document.pk)})
assert not result.errors

Expand Down
4 changes: 3 additions & 1 deletion caluma/tests/snapshots/snap_test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@
source: Question
forms(before: String, after: String, first: Int, last: Int, metaValue: MetaValueFilterType, orderBy: [FormOrdering], slug: String, name: String, description: String, isPublished: Boolean, isArchived: Boolean, createdByUser: String, createdByGroup: String, metaHasKey: String, search: String): FormConnection
options(before: String, after: String, first: Int, last: Int, metaValue: MetaValueFilterType, orderBy: [OptionOrdering], slug: String, label: String, createdByUser: String, createdByGroup: String, metaHasKey: String, search: String): OptionConnection
staticContent: String
id: ID!
}
Expand Down Expand Up @@ -1329,8 +1330,9 @@
infoText: String
meta: GenericScalar!
source: Question
forms(before: String, after: String, first: Int, last: Int, orderBy: [FormOrdering], slug: String, name: String, description: String, isPublished: Boolean, isArchived: Boolean, createdByUser: String, createdByGroup: String, metaHasKey: String, search: String): FormConnection
forms(before: String, after: String, first: Int, last: Int, metaValue: MetaValueFilterType, orderBy: [FormOrdering], slug: String, name: String, description: String, isPublished: Boolean, isArchived: Boolean, createdByUser: String, createdByGroup: String, metaHasKey: String, search: String): FormConnection
staticContent: String
dataSource: String
id: ID!
isRequired: QuestionJexl!
}
Expand Down

0 comments on commit e59584b

Please sign in to comment.