예제 #1
0
 def test_convert_scalar_to_float(self):
     migrations.enable_migrations(True)
     self.assertTrue(
         scalars_equal(self.scalar_float,
                       migrations.maybe_get_float(self.scalar_float)))
     self.assertTrue(
         scalars_equal(self.scalar_float,
                       migrations.maybe_get_float(self.scalar_int)))
예제 #2
0
 def test_convert_list_to_float(self):
     migrations.enable_migrations(True)
     self.assertTrue(
         lists_equal(self.list_of_floats,
                     migrations.maybe_get_float(self.list_of_floats)))
     self.assertTrue(
         lists_equal(self.list_of_floats,
                     migrations.maybe_get_float(self.list_of_ints)))
예제 #3
0
 def test_convert_array_to_float(self):
     migrations.enable_migrations(True)
     self.assertTrue(
         arrays_equal(self.array_of_floats,
                      migrations.maybe_get_float(self.array_of_floats)))
     self.assertTrue(
         arrays_equal(self.array_of_floats,
                      migrations.maybe_get_float(self.array_of_ints)))
예제 #4
0
 def test_no_migrations(self):
     migrations.enable_migrations(False)
     self.assertTrue(
         arrays_equal(self.array_of_ints,
                      migrations.maybe_get_float(self.array_of_ints)))
     self.assertTrue(
         arrays_equal(self.array_of_floats,
                      migrations.maybe_get_float(self.array_of_floats)))
     self.assertTrue(
         lists_equal(self.list_of_ints,
                     migrations.maybe_get_float(self.list_of_ints)))
     self.assertTrue(
         lists_equal(self.list_of_floats,
                     migrations.maybe_get_float(self.list_of_floats)))
     self.assertTrue(
         scalars_equal(self.scalar_int,
                       migrations.maybe_get_float(self.scalar_int)))
     self.assertTrue(
         scalars_equal(self.scalar_float,
                       migrations.maybe_get_float(self.scalar_float)))
     self.assertTrue(
         scalars_equal(self.scalar_str,
                       migrations.maybe_get_float(self.scalar_str)))
예제 #5
0
 def tearDown(self) -> None:
     if self.prev_migration:
         migrations.enable_migrations(True)
     else:
         migrations.enable_migrations(False)
예제 #6
0
 def test_bad_data(self):
     migrations.enable_migrations(True)
     self.assertTrue(scalars_equal(None, migrations.maybe_get_float(None)))
     self.assertTrue(
         scalars_equal(self.scalar_str,
                       migrations.maybe_get_float(self.scalar_str)))