def test_edly_configuration_values(self): """ Test that method "get_edly_configuration_value" returns correct value for any given key. """ test_configuration_value = { "CACHE_TIMEOUT": 900, "SERVICES_NOTIFICATIONS_COOKIE_EXPIRY": "360", "PANEL_NOTIFICATIONS_BASE_URL": "http://panel.backend.dev.edly.com:9999" } # add SiteConfiguration to database site_configuration = SiteConfigurationFactory.create( edly_client_theme_branding_settings=test_configuration_value, ) # Make sure entry is saved and retrieved correctly self.assertEqual( site_configuration.get_edly_configuration_value( 'SERVICES_NOTIFICATIONS_COOKIE_EXPIRY'), test_configuration_value['SERVICES_NOTIFICATIONS_COOKIE_EXPIRY']) self.assertEqual( site_configuration.get_edly_configuration_value( 'PANEL_NOTIFICATIONS_BASE_URL'), test_configuration_value['PANEL_NOTIFICATIONS_BASE_URL']) # Test that the default value is returned if the value for the given key is not found in the configuration self.assertEqual( site_configuration.get_edly_configuration_value( 'non_existent_name', 'dummy-default-value'), 'dummy-default-value', )
def setUp(self): """ Set up initial data (e.g., site configuration, category) prior to running tests """ super(SeedEnterpriseDevstackDataTests, self).setUp() self.site_config = SiteConfigurationFactory.create( oauth_settings=self.site_oauth_settings, ) self.command = seed_command() self.command.site = self.site_config CategoryFactory.create(name='coupons') self.ent_customer_uuid = str(uuid4()) self.ent_catalog_uuid = str(uuid4()) self.access_token = 'fake_access_token'
def setUp(self): super(TestSyncHubspotCommand, self).setUp() self.hubspot_site_configuration = SiteConfigurationFactory.create( hubspot_secret_key='test_key', ) self.order = self._create_order('1122', self.hubspot_site_configuration.site)