@@ -0,0 +1,2496 @@
+%22%22%22Tests for PATCHing an edition to change the tracking mode from%0AGIT_REF to LSST_DOC.%0A%22%22%22%0A%0A%0Adef test_pach_lsst_doc_edition(client):%0A    %22%22%22Test patching an edition from tracking a Git ref to an LSST doc.%0A%0A    1. Create a product with the default GIT_REF tracking mode for the%0A       main edition.%0A    2. Post a build on %60master%60; it is tracked.%0A    3. Post a %60v1.0%60 build; it is not tracked.%0A    4. Patch the main edition to use the LSST_DOC tracking mode.%0A    5. Post a %60v1.1%60 build that is tracked.%0A    %22%22%22%0A    # Add product%0A    p1_data = %7B%0A        'slug': 'ldm-151',%0A        'doc_repo': 'https://github.com/lsst/LDM-151',%0A        'main_mode': 1,  # default%0A        'title': 'Applications Design',%0A        'root_domain': 'lsst.io',%0A        'root_fastly_domain': 'global.ssl.fastly.net',%0A        'bucket_name': 'bucket-name'%0A    %7D%0A    r = client.post('/products/', p1_data)%0A    assert r.status == 201%0A%0A    # Get the URL for the default edition%0A    r = client.get('/products/ldm-151/editions/')%0A    edition_url = r.json%5B'editions'%5D%5B0%5D%0A%0A    # Create a build on 'master'%0A    b1_data = %7B%0A        'slug': 'b1',%0A        'github_requester': 'jonathansick',%0A        'git_refs': %5B'master'%5D%0A    %7D%0A    r = client.post('/products/ldm-151/builds/', b1_data)%0A    b1_url = r.headers%5B'Location'%5D%0A    r = client.patch(b1_url, %7B'uploaded': True%7D)%0A    # Test that the main edition updated.%0A    r = client.get(edition_url)%0A    assert r.json%5B'build_url'%5D == b1_url%0A%0A    # Create a build with a semantic version tag.%0A    b2_data = %7B%0A        'slug': 'b2',%0A        'github_requester': 'jonathansick',%0A        'git_refs': %5B'v1.0'%5D%0A    %7D%0A    r = client.post('/products/ldm-151/builds/', b2_data)%0A    b2_url = r.headers%5B'Location'%5D%0A    r = client.patch(b2_url, %7B'uploaded': True%7D)%0A    # Test that the main edition *did not* update%0A    r = client.get(edition_url)%0A    assert r.json%5B'build_url'%5D == b1_url%0A%0A    # PATCH the tracking mode of the edition%0A    edition_patch_data = %7B%0A        'mode': 2%0A    %7D%0A    r = client.patch(edition_url, edition_patch_data)%0A    assert r.status == 200%0A%0A    # Create another build with a semantic version tag.%0A    b3_data = %7B%0A        'slug': 'b3',%0A        'github_requester': 'jonathansick',%0A        'git_refs': %5B'v1.1'%5D%0A    %7D%0A    r = client.post('/products/ldm-151/builds/', b3_data)%0A    b3_url = r.headers%5B'Location'%5D%0A    r = client.patch(b3_url, %7B'uploaded': True%7D)%0A    # Test that the main edition *did* update now%0A    r = client.get(edition_url)%0A    assert r.json%5B'build_url'%5D == b3_url%0A

Add test_patch_edition_mode test case