예제 #1
0
    def test_get_standby_plproxy_config_legacy_format(self):
        config = PlProxyConfig.from_legacy_dict(TEST_LEGACY_FORMAT)
        self.assertEqual('proxy', config.proxy_db)
        self.assertEqual({'db1', 'db2'}, set(config.form_processing_dbs))

        databases = copy.deepcopy(TEST_DATABASES)
        databases.update({
            'db1_standby': {'STANDBY': {'MASTER': 'db1'}},
            'db2_standby': {'STANDBY': {'MASTER': 'db2'}},
        })

        with override_settings(DATABASES=databases):
            _get_standby_plproxy_config(config)
예제 #2
0
 def test_legacy_format(self):
     config = PlProxyConfig.from_legacy_dict(TEST_LEGACY_FORMAT)
     self.assertEqual('proxy', config.proxy_db)
     self.assertEqual({'db1', 'db2'}, set(config.form_processing_dbs))