~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/tests/helpers.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-22 04:46:24 UTC
  • mfrom: (14562.1.4 apocalypse)
  • Revision ID: launchpad@pqm.canonical.com-20111222044624-zzfwcfyel4n7bjpu
[r=wgrant][no-qa] Move some test helpers from canonical.launchpad to
        lp.*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    'make_official_package_branch',
14
14
    'make_project_branch_with_revisions',
15
15
    'make_project_cloud_data',
 
16
    'remove_all_sample_data_branches',
16
17
    ]
17
18
 
18
19
 
29
30
    removeSecurityProxy,
30
31
    )
31
32
 
 
33
from canonical.database.sqlbase import cursor
32
34
from lp.code.interfaces.branchmergeproposal import (
33
35
    IBranchMergeProposalJobSource,
34
36
    )
327
329
    return '~%s/%s/%s/%s/%s' % (
328
330
        owner, distroseries.distribution.name, distroseries.name,
329
331
        source_package, branch)
 
332
 
 
333
 
 
334
def remove_all_sample_data_branches():
 
335
    c = cursor()
 
336
    c.execute('delete from bugbranch')
 
337
    c.execute('delete from specificationbranch')
 
338
    c.execute('update productseries set branch=NULL')
 
339
    c.execute('delete from branchrevision')
 
340
    c.execute('delete from branchsubscription')
 
341
    c.execute('delete from codeimportjob')
 
342
    c.execute('delete from codeimport')
 
343
    c.execute('delete from branch')