File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 122
122
# https://docs.djangoproject.com/en/1.9/howto/static-files/
123
123
124
124
STATIC_URL = '/static/'
125
- DJANGO_CELERY_BEAT_NAME_MAX_LENGTH = 191
126
125
DJANGO_CELERY_BEAT_TZ_AWARE = True
Original file line number Diff line number Diff line change
1
+ from __future__ import absolute_import , unicode_literals
2
+
3
+ import importlib
4
+
5
+ from django .test import TestCase
6
+
7
+ from django_celery_beat .models import PeriodicTask
8
+
9
+
10
+ class ModelMigrationTests (TestCase ):
11
+ def test_periodic_task_name_max_length_defaults_to_200_in_model (self ):
12
+ self .assertEqual (200 , PeriodicTask ._meta .get_field ('name' ).max_length )
13
+
14
+ def test_periodic_task_name_max_length_defaults_to_200_in_migration (self ):
15
+ initial_migration = importlib .import_module ('django_celery_beat.migrations.0001_initial' ).Migration
16
+ periodic_task_creation = initial_migration .operations [2 ]
17
+ fields = dict (periodic_task_creation .fields )
18
+
19
+ self .assertEqual ('PeriodicTask' , periodic_task_creation .name )
20
+ self .assertEqual (200 , fields ['name' ].max_length )
You can’t perform that action at this time.
0 commit comments