def test_dry_run(self, os, sub): mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = True mock_args.nomigrations = False with patch.object(commandline, 'find_application_name') as namer: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) os.assert_any_call('python manage.py makemigrations opal --traceback --dry-run')
def test_dry_run(self, os, sub): mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = True with patch.object(commandline, 'find_application_name') as namer: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) os.assert_any_call( 'python manage.py makemigrations opal --traceback --dry-run')
def test_episode_subrecord_no_display_template(self, episub, os, sub): from opal import models episub.return_value = False mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = False with patch.object(commandline, 'find_application_name') as namer: with patch.object(commandline.scaffold_utils, 'create_display_template_for') as c: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) c.assert_any_call(models.Diagnosis, commandline.SCAFFOLDING_BASE)
def test_episode_subrecord_no_form_template_dry_run(self, episub, os, sub): from opal import models episub.return_value = False mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = True with patch.object(commandline, 'find_application_name') as namer: with patch.object(commandline, 'write') as writer: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) writer.assert_any_call("No Form template for <class 'opal.models.Diagnosis'>")
def test_episode_subrecord_no_form_template_dry_run(self, episub, os, sub): from opal import models episub.return_value = False mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = True with patch.object(commandline, 'find_application_name') as namer: with patch.object(commandline, 'write') as writer: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) writer.assert_any_call( "No Form template for <class 'opal.models.Diagnosis'>")
def test_episode_subrecord_no_display_template(self, episub, os, sub): from opal import models episub.return_value = False mock_args = MagicMock(name='Mock Args') mock_args.app = 'opal' mock_args.dry_run = False with patch.object(commandline, 'find_application_name') as namer: with patch.object(commandline.scaffold_utils, 'create_display_template_for') as c: namer.return_value = 'opal.tests' commandline.scaffold(mock_args) c.assert_any_call(models.Diagnosis, commandline.SCAFFOLDING_BASE)