-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from modoboa/fix/import_backend_detection
Added option to force import backend
- Loading branch information
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -375,7 +375,7 @@ def test_import_unknown_backend(self): | |
self.assertEqual(str(ctx.exception), | ||
"Failed to detect backend to use") | ||
|
||
def test_import_from_outlook(self): | ||
def test_import_from_outlook_auto(self): | ||
management.call_command( | ||
"import_contacts", "[email protected]", self.path) | ||
address = models.EmailAddress.objects.get( | ||
|
@@ -389,6 +389,24 @@ def test_import_from_outlook(self): | |
"Street 1 Street 2" | ||
) | ||
|
||
def test_import_from_outlook(self): | ||
management.call_command( | ||
"import_contacts", | ||
"[email protected]", | ||
self.path, | ||
backend="outlook", | ||
) | ||
address = models.EmailAddress.objects.get( | ||
address="[email protected]") | ||
phone = models.PhoneNumber.objects.get( | ||
number="12345678") | ||
self.assertEqual(address.contact.first_name, "Toto Tata") | ||
self.assertEqual(address.contact.addressbook.user.email, "[email protected]") | ||
self.assertEqual( | ||
address.contact.address, | ||
"Street 1 Street 2" | ||
) | ||
|
||
def test_import_and_carddav_sync(self): | ||
with httmock.HTTMock(mocks.options_mock, mocks.put_mock): | ||
management.call_command( | ||
|