def test_create_manifest_multiple_origins_and_permissions(self): creator = SitePermissionVersionCreator( user=user_factory(), remote_addr='4.8.15.16', install_origins=['https://example.com', 'https://foo.com'], site_permissions=['midi-sysex', 'webblah'], ) manifest_data = creator._create_manifest('2.0') assert manifest_data == { 'browser_specific_settings': { 'gecko': { 'strict_min_version': '97.0' } }, 'install_origins': ['https://example.com', 'https://foo.com'], 'manifest_version': 2, 'name': 'Site permissions for example.com, foo.com', 'site_permissions': ['midi-sysex', 'webblah'], 'version': '2.0', }
def test_create_manifest_with_guid(self): creator = SitePermissionVersionCreator( user=user_factory(), remote_addr='4.8.15.16', install_origins=['https://example.com'], site_permissions=['midi-sysex'], ) manifest_data = creator._create_manifest('1.0', 'some@guid') guid = ( manifest_data.get('browser_specific_settings', {}) .get('gecko', {}) .get('id') ) assert guid == 'some@guid' assert manifest_data == { 'browser_specific_settings': { 'gecko': {'id': guid, 'strict_min_version': '97.0'} }, 'install_origins': ['https://example.com'], 'manifest_version': 2, 'name': 'Site permissions for example.com', 'site_permissions': ['midi-sysex'], 'version': '1.0', }