~bac/charms/precise/wordpress/correct-wp-content

« back to all changes in this revision

Viewing changes to tests/helper.py

  • Committer: Tim Van Steenburgh
  • Date: 2014-11-21 19:13:08 UTC
  • mfrom: (77.1.2 wordpress)
  • Revision ID: tim.van.steenburgh@canonical.com-20141121191308-xw6fk4zbmpn22epv
[marcoceppi] Added tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import requests
 
2
 
 
3
 
 
4
def finish_setup(unit, user='admin', password=None):
 
5
    h = {'User-Agent': 'Mozilla/5.0 Gecko/20100101 Firefox/12.0',
 
6
         'Content-Type': 'application/x-www-form-urlencoded',
 
7
         'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*',
 
8
         'Accept-Encoding': 'gzip, deflate'}
 
9
 
 
10
    r = requests.post('http://%s/wp-admin/install.php?step=2' % unit,
 
11
                      headers=h, data={'weblog_title': 'Amulet Test %s' % unit,
 
12
                      'user_name': user, 'admin_password': password,
 
13
                      'admin_email': 'test@example.tld',
 
14
                      'admin_password2': password,
 
15
                      'Submit': 'Install WordPress'}, proxies=None)
 
16
 
 
17
    r.raise_for_status()