~flo-fuchs/postorius/testing

« back to all changes in this revision

Viewing changes to src/postorius/tests/mailman_api_tests/test_list_index.py

  • Committer: Florian Fuchs
  • Date: 2015-01-25 21:55:47 UTC
  • Revision ID: flo.fuchs@gmail.com-20150125215547-5hmqgnezvdw6g2d8
added vcrpy to some tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import logging
19
19
 
20
 
from django.conf import settings
21
20
from django.core.urlresolvers import reverse
22
21
from django.test import Client, SimpleTestCase
23
22
from django.test.utils import override_settings
28
27
 
29
28
 
30
29
logger = logging.getLogger(__name__)
 
30
vcr_log = logging.getLogger('vcr')
 
31
vcr_log.setLevel(logging.WARNING)
31
32
 
32
33
 
33
34
API_CREDENTIALS = {'MAILMAN_API_URL': 'http://localhost:9001',
39
40
class ListIndexPageTest(SimpleTestCase):
40
41
    """Tests for the list index page."""
41
42
 
42
 
    @MM_VCR.use_cassette('test_list_index.yaml')
 
43
    @MM_VCR.use_cassette('test_list_index/list_index_page/setup.yaml')
43
44
    def setUp(self):
44
45
        self.client = Client()
45
46
        try:
48
49
            self.domain = get_client().get_domain('example.com')
49
50
        self.foo_list = self.domain.create_list('foo')
50
51
 
51
 
    @MM_VCR.use_cassette('test_list_index.yaml')
 
52
    @MM_VCR.use_cassette('test_list_index/list_index_page/teardown.yaml')
52
53
    def tearDown(self):
53
54
        for mlist in get_client().lists:
54
55
            mlist.delete()
55
56
 
56
 
    @MM_VCR.use_cassette('test_list_index.yaml')
 
57
    @MM_VCR.use_cassette('test_list_index/list_index_page/'
 
58
                         'list_index_contains_one_list.yaml')
57
59
    def test_list_index_contains_one_list(self):
58
60
        # The list index page should contain the
59
61
        response = self.client.get(reverse('list_index'))