'Verify the settings for APNS platform.'

def test_validate_apns_config(self):

    path = os.path.join(os.path.dirname(__file__), 'test_data', 'good_revoked.pem')
    PUSH_SETTINGS = {'APPLICATIONS': {'my_apns_app': {'PLATFORM': 'APNS', 'CERTIFICATE': path, 'USE_ALTERNATIVE_PORT': True, 'USE_SANDBOX': True}}}
    AppConfig(PUSH_SETTINGS)
    PUSH_SETTINGS = {'APPLICATIONS': {'my_apns_app': {'PLATFORM': 'APNS'}}}
    with self.assertRaises(ImproperlyConfigured) as ic:
        AppConfig(PUSH_SETTINGS)
    self.assertEqual(str(ic.exception), "PUSH_NOTIFICATIONS_SETTINGS.APPLICATIONS['my_apns_app']['CERTIFICATE']    is    missing.")
    PUSH_SETTINGS = {'APPLICATIONS': {'my_apns_app': {'PLATFORM': 'APNS', 'CERTIFICATE': path}}}
    manager = AppConfig(PUSH_SETTINGS)
    app_config = manager._settings['APPLICATIONS']['my_apns_app']
    assert (app_config['USE_SANDBOX'] is False)
    assert (app_config['USE_ALTERNATIVE_PORT'] is False)
