def test_downstream_toggle_enabled_in_local_link(self): set_toggle('test_toggle', self.domain_link.master_domain, True, NAMESPACE_DOMAIN) update_toggles(self.domain_link) self.assertTrue( TEST_TOGGLE.enabled(self.domain_link.linked_domain, NAMESPACE_DOMAIN))
def test_downstream_preview_enabled_in_local_link(self): set_toggle('test_preview', self.domain_link.master_domain, True, NAMESPACE_DOMAIN) update_previews(self.domain_link) self.assertTrue( TEST_PREVIEW.enabled(self.domain_link.linked_domain, NAMESPACE_DOMAIN))
def setUpClass(cls): super().setUpClass() cls.domain = 'test' cls.domain_obj = create_domain(cls.domain) set_toggle(FILTERED_BULK_USER_DOWNLOAD.slug, cls.domain, True, namespace=NAMESPACE_DOMAIN) location_type = LocationType(domain=cls.domain, name='phony') location_type.save() cls.some_location = make_loc('1', 'some_location', type=location_type, domain=cls.domain_obj.name) cls.admin_user = WebUser.create( cls.domain_obj.name, '*****@*****.**', 'badpassword', None, None, email='*****@*****.**', first_name='Edith', last_name='Wharton', is_admin=True, ) cls.admin_user_with_location = WebUser.create( cls.domain_obj.name, '*****@*****.**', 'badpassword', None, None, email='*****@*****.**', first_name='Edith', last_name='Wharton', is_admin=True, ) cls.admin_user_with_location.set_location(cls.domain, cls.some_location) populate_user_index([ cls.admin_user_with_location, cls.admin_user, ])
def _inner(request, to_domain, data, from_domain=domain): clear_app_cache(request, to_domain) if data['toggles']: for slug in data['toggles'].split(","): set_toggle(slug, to_domain, True, namespace=toggles.NAMESPACE_DOMAIN) linked = data.get('linked') if linked: return _create_linked_app(request, app_id, data['build_id'], from_domain, to_domain, data['name']) else: return _copy_app_helper(request, data['build_id'] or app_id, to_domain, data['name'])
def test_get_enabled_previews(self): set_toggle('test_preview', self.domain_link.master_domain, True, NAMESPACE_DOMAIN) enabled_previews = get_enabled_previews(self.domain_link.master_domain) self.assertEqual(['test_preview'], enabled_previews)
def tearDown(self): super(TestUpdatePreviews, self).tearDown() set_toggle('test_preview', self.domain_link.master_domain, False, NAMESPACE_DOMAIN) set_toggle('test_preview', self.domain_link.linked_domain, False, NAMESPACE_DOMAIN)
def _set_toggles(collection, enabled): for slug in collection: set_toggle(slug, domain_link.linked_domain, enabled, NAMESPACE_DOMAIN)