Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion employees/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class ReportModelConstants(Enum):
MAX_DESCRIPTION_LENGTH = 1024
MAX_DESCRIPTION_LENGTH = 4096
MAX_DIGITS = 4
DECIMAL_PLACES = 2
MAX_WORK_HOURS = Decimal("24.00")
Expand Down
18 changes: 18 additions & 0 deletions employees/migrations/0004_auto_20190507_1124.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.1 on 2019-05-07 11:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('employees', '0003_auto_20190423_2020'),
]

operations = [
migrations.AlterField(
model_name='report',
name='description',
field=models.TextField(max_length=4096),
),
]
2 changes: 1 addition & 1 deletion employees/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __str__(self) -> str:
class Report(models.Model):

date = models.DateField()
description = models.CharField(max_length=ReportModelConstants.MAX_DESCRIPTION_LENGTH.value)
description = models.TextField(max_length=ReportModelConstants.MAX_DESCRIPTION_LENGTH.value)
task_activities = models.ForeignKey(TaskActivityType, on_delete=models.SET_DEFAULT, default=1)
creation_date = models.DateTimeField(auto_now_add=True)
last_update = models.DateTimeField(auto_now=True)
Expand Down
5 changes: 0 additions & 5 deletions employees/tests/test_unit_report_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ def test_report_model_date_field_should_not_accept_non_date_value(self):


class TestReportDescriptionParameterFails(DataSetUpToTests):

# PARAM
def test_report_model_description_field_should_not_accept_string_longer_than_set_limit(self):
self.field_should_not_accept_input("description", "a" * (ReportModelConstants.MAX_DESCRIPTION_LENGTH.value + 1))

def test_report_model_description_field_should_not_be_empty(self):
self.field_should_not_accept_null("description")

Expand Down