def test_it_should_return_an_empty_string_if_sql_or_script_encoding_are_invalid(self): self.assertEqual('', Migration.ensure_sql_unicode('', '')) self.assertEqual('', Migration.ensure_sql_unicode('', "iso8859-1")) self.assertEqual('', Migration.ensure_sql_unicode('', None)) self.assertEqual('', Migration.ensure_sql_unicode('', False)) self.assertEqual('', Migration.ensure_sql_unicode('sql', '')) self.assertEqual('', Migration.ensure_sql_unicode(None, "iso8859-1")) self.assertEqual('', Migration.ensure_sql_unicode(False, "iso8859-1"))
def test_it_should_return_an_empty_string_if_sql_or_script_encoding_are_invalid(self): self.assertEqual('', Migration.ensure_sql_unicode('', '')) self.assertEqual('', Migration.ensure_sql_unicode('', "iso8859-1")) self.assertEqual('', Migration.ensure_sql_unicode('', None)) self.assertEqual('', Migration.ensure_sql_unicode('', False)) self.assertEqual('', Migration.ensure_sql_unicode('sql', '')) self.assertEqual('', Migration.ensure_sql_unicode(None, "iso8859-1")) self.assertEqual('', Migration.ensure_sql_unicode(False, "iso8859-1"))
def test_it_should_convert_sql_to_unicode_from_script_encoding(self): self.assertEqual(u'sql in iso8859-1', Migration.ensure_sql_unicode('sql in iso8859-1'.encode("iso8859-1"), "iso8859-1"))
def test_it_should_convert_sql_to_unicode_from_script_encoding(self): self.assertEqual( u'sql in iso8859-1', Migration.ensure_sql_unicode( 'sql in iso8859-1'.encode("iso8859-1"), "iso8859-1"))