コード例 #1
0
ファイル: backup.py プロジェクト: hassanNS/avocado
    def test_safe_load_tmp(self):
        from avocado.core import backup
        from avocado.models import DataField

        management.call_command('avocado', 'init', 'tests', quiet=True)
        self.assertEqual(DataField.objects.count(), 18)

        backup_path = backup.safe_load('0001_avocado_metadata')

        self.assertTrue(os.path.exists(backup_path))
        self.assertEqual(DataField.objects.count(), 3)
        os.remove(backup_path)
コード例 #2
0
    def test_safe_load_tmp(self):
        from avocado.core import backup
        from avocado.models import DataField

        management.call_command('avocado', 'init', 'tests', quiet=True)
        self.assertEqual(DataField.objects.count(), 12)

        backup_path = backup.safe_load('0001_avocado_metadata')

        self.assertTrue(os.path.exists(backup_path))
        self.assertEqual(DataField.objects.count(), 3)
        os.remove(backup_path)
コード例 #3
0
ファイル: tests.py プロジェクト: pombredanne/avocado
    def test_safe_load(self):
        from avocado.core import backup
        from avocado.models import DataField

        management.call_command("avocado", "init", "subcommands")
        self.assertEqual(DataField.objects.count(), 11)

        backup_path = backup.safe_load("0001_avocado_metadata", backup_path="backup.json")

        self.assertTrue(os.path.exists("backup.json"))
        self.assertEqual(DataField.objects.count(), 3)
        os.remove(backup_path)
コード例 #4
0
 def forwards(self, orm):
     "Perform a 'safe' load using Avocado's backup utilities."
     from avocado.core import backup
     backup.safe_load(u'0002_avocado_metadata',
                      backup_path=None,
                      using='default')
 def forwards(self, orm):
     "Perform a 'safe' load using Avocado's backup utilities."
     from avocado.core import backup
     backup.safe_load(u'0002_avocado_metadata', backup_path=None,
         using='default')