Skip to content

Commit

Permalink
Merge pull request #96 from ambitioninc/develop
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
thinkt4nk committed Aug 18, 2022
2 parents 4587fe0 + 3e86414 commit 111173e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
3 changes: 3 additions & 0 deletions data_schema/docs/release_notes.rst
@@ -1,5 +1,8 @@
Release Notes

v1.5.0
------
* Update display_name field on FieldSchema to no longer have a char limit.

v1.4.0
------
Expand Down
18 changes: 18 additions & 0 deletions data_schema/migrations/0006_auto_20220818_1425.py
@@ -0,0 +1,18 @@
# Generated by Django 2.2.28 on 2022-08-18 14:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data_schema', '0005_auto_20180302_2356'),
]

operations = [
migrations.AlterField(
model_name='fieldschema',
name='display_name',
field=models.TextField(blank=True, default=''),
),
]
2 changes: 1 addition & 1 deletion data_schema/models.py
Expand Up @@ -159,7 +159,7 @@ def __str__(self):
field_key = models.CharField(max_length=255)

# Optional way to display the field. defaults to the field_key
display_name = models.CharField(max_length=64, blank=True, default='')
display_name = models.TextField(blank=True, default='')

# The order in which this field appears in the UID for the record. It is null if it does
# not appear in the uniqueness constraint
Expand Down
20 changes: 19 additions & 1 deletion data_schema/tests/model_tests.py
@@ -1,6 +1,7 @@
from django.test import TestCase
from django_dynamic_fixture import G

from data_schema.models import FieldSchema
from data_schema.models import FieldSchema, DataSchema


class FieldSchemaTest(TestCase):
Expand All @@ -9,3 +10,20 @@ def test_unicode(self):
field = FieldSchema(field_key='key', display_name='Field', id=10)

self.assertEqual(str(field), u'10 - key - Field')

def test_display_name_no_character_limit(self):
"""
Test to ensure that we are no longer running into the 64 character limit for display_name on the FieldSchema
"""
data_schema = G(DataSchema)
field_schema = FieldSchema(
data_schema=data_schema,
field_key='testing_id',
display_name='Testing this is longer than 64 characters and we are no longer failing')

field_schema.save()

self.assertEqual(
field_schema.display_name,
'Testing this is longer than 64 characters and we are no longer failing'
)
2 changes: 1 addition & 1 deletion data_schema/version.py
@@ -1 +1 @@
__version__ = '1.4.0'
__version__ = '1.5.0'

0 comments on commit 111173e

Please sign in to comment.