fix(parsers): widen industrial product code fields
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("parsers", "0020_merge_20260428_2300"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="industrialproductrecord",
|
||||
name="okpd2_code",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
help_text="Код по ОКПД2",
|
||||
max_length=255,
|
||||
verbose_name="код ОКПД2",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="industrialproductrecord",
|
||||
name="tnved_code",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
help_text="Код по ТН ВЭД",
|
||||
max_length=255,
|
||||
verbose_name="код ТН ВЭД",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -318,13 +318,13 @@ class IndustrialProductRecord(TimestampMixin, models.Model):
|
||||
)
|
||||
okpd2_code = models.CharField(
|
||||
_("код ОКПД2"),
|
||||
max_length=20,
|
||||
max_length=255,
|
||||
blank=True,
|
||||
help_text=_("Код по ОКПД2"),
|
||||
)
|
||||
tnved_code = models.CharField(
|
||||
_("код ТН ВЭД"),
|
||||
max_length=20,
|
||||
max_length=255,
|
||||
blank=True,
|
||||
help_text=_("Код по ТН ВЭД"),
|
||||
)
|
||||
|
||||
@@ -199,3 +199,14 @@ class IndustrialProductRecordModelTest(TestCase):
|
||||
|
||||
self.assertIsNotNone(product.created_at)
|
||||
self.assertIsNotNone(product.updated_at)
|
||||
|
||||
def test_product_codes_allow_source_specific_long_values(self):
|
||||
"""Test source code fields accept official registry combined values."""
|
||||
self.assertEqual(
|
||||
IndustrialProductRecord._meta.get_field("okpd2_code").max_length,
|
||||
255,
|
||||
)
|
||||
self.assertEqual(
|
||||
IndustrialProductRecord._meta.get_field("tnved_code").max_length,
|
||||
255,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user