mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Added unit test to cover import of non utf8 files.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
domain;domain1.com;1000;100;True
|
||||
domain;dómain2.com;2000;200;True
|
||||
|
@@ -387,6 +387,15 @@ dómain; dómªin2.com; 1000; 100; True
|
||||
self.assertTrue(dom.enabled)
|
||||
self.assertTrue(admin.is_owner(dom))
|
||||
|
||||
def test_import_command_non_utf8(self):
|
||||
test_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"test_data/import_domains_iso8859.csv"
|
||||
)
|
||||
call_command("modo", "import", test_file)
|
||||
dom = Domain.objects.get(name="dómain2.com")
|
||||
self.assertEqual(dom.quota, 2000)
|
||||
|
||||
def test_import_command_duplicates(self):
|
||||
test_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
|
||||
Reference in New Issue
Block a user