mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #30186 -- Made showmigrations --list display the applied datetimes at verbosity 2+.
This commit is contained in:
parent
371ddade1e
commit
7c68cea7ee
4 changed files with 30 additions and 4 deletions
|
@ -250,6 +250,16 @@ class MigrateTests(MigrationTestBase):
|
|||
' [ ] 0002_second\n',
|
||||
out.getvalue().lower()
|
||||
)
|
||||
out = io.StringIO()
|
||||
# Applied datetimes are displayed at verbosity 2+.
|
||||
call_command('showmigrations', 'migrations', stdout=out, verbosity=2, no_color=True)
|
||||
migration1 = MigrationRecorder(connection).migration_qs.get(app='migrations', name='0001_initial')
|
||||
self.assertEqual(
|
||||
'migrations\n'
|
||||
' [x] 0001_initial (applied at %s)\n'
|
||||
' [ ] 0002_second\n' % migration1.applied.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
out.getvalue().lower()
|
||||
)
|
||||
# Cleanup by unmigrating everything
|
||||
call_command("migrate", "migrations", "zero", verbosity=0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue