'Test backend argument of mail.get_connection()'

def test_backend_arg(self):

    self.assertIsInstance(mail.get_connection(u'django.core.mail.backends.smtp.EmailBackend'), smtp.EmailBackend)
    self.assertIsInstance(mail.get_connection(u'django.core.mail.backends.locmem.EmailBackend'), locmem.EmailBackend)
    self.assertIsInstance(mail.get_connection(u'django.core.mail.backends.dummy.EmailBackend'), dummy.EmailBackend)
    self.assertIsInstance(mail.get_connection(u'django.core.mail.backends.console.EmailBackend'), console.EmailBackend)
    tmp_dir = tempfile.mkdtemp()
    try:
        self.assertIsInstance(mail.get_connection(u'django.core.mail.backends.filebased.EmailBackend', file_path=tmp_dir), filebased.EmailBackend)
    finally:
        shutil.rmtree(tmp_dir)
    self.assertIsInstance(mail.get_connection(), locmem.EmailBackend)
