~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/answers/browser/tests/question-subscribe_me.txt

Add support for IQuestion.canBeUnsubscribedBy plus tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
Empty the subscribers list:
19
19
 
20
 
    >>> firefox_question.unsubscribe(sample_person)
 
20
    >>> firefox_question.unsubscribe(sample_person, sample_person)
21
21
    >>> list(firefox_question.subscriptions)
22
22
    []
23
23
 
36
36
    >>> workflow_harness.submit('requestinfo', form_data)
37
37
    >>> firefox_question.isSubscribed(foo_bar)
38
38
    True
39
 
    >>> firefox_question.unsubscribe(foo_bar)
 
39
    >>> firefox_question.unsubscribe(foo_bar, foo_bar)
40
40
 
41
41
Subscription is possible when providing more information:
42
42
 
44
44
    >>> workflow_harness.submit('giveinfo', form_data)
45
45
    >>> firefox_question.isSubscribed(sample_person)
46
46
    True
47
 
    >>> firefox_question.unsubscribe(sample_person)
 
47
    >>> firefox_question.unsubscribe(sample_person, sample_person)
48
48
 
49
49
Subscription is possible when providing an answer:
50
50
 
52
52
    >>> workflow_harness.submit('answer', form_data)
53
53
    >>> firefox_question.isSubscribed(foo_bar)
54
54
    True
55
 
    >>> firefox_question.unsubscribe(foo_bar)
 
55
    >>> firefox_question.unsubscribe(foo_bar, foo_bar)
56
56
 
57
57
As when confirming an answer (altough this is probably not that common):
58
58
 
60
60
    >>> workflow_harness.submit('confirm', dict(answer_id=-1, **form_data))
61
61
    >>> firefox_question.isSubscribed(sample_person)
62
62
    True
63
 
    >>> firefox_question.unsubscribe(sample_person)
 
63
    >>> firefox_question.unsubscribe(sample_person, sample_person)
64
64
 
65
65
It is also possible when reopening the request.
66
66
 
67
67
    >>> workflow_harness.submit('reopen', form_data)
68
68
    >>> firefox_question.isSubscribed(sample_person)
69
69
    True
70
 
    >>> firefox_question.unsubscribe(sample_person)
 
70
    >>> firefox_question.unsubscribe(sample_person, sample_person)
71
71
 
72
72
Self-Answering the request:
73
73
 
74
74
    >>> workflow_harness.submit('selfanswer', form_data)
75
75
    >>> firefox_question.isSubscribed(sample_person)
76
76
    True
77
 
    >>> firefox_question.unsubscribe(sample_person)
 
77
    >>> firefox_question.unsubscribe(sample_person, sample_person)
78
78
 
79
79
As well as adding a comment:
80
80
 
81
81
    >>> workflow_harness.submit('comment', form_data)
82
82
    >>> firefox_question.isSubscribed(sample_person)
83
83
    True
84
 
    >>> firefox_question.unsubscribe(sample_person)
 
84
    >>> firefox_question.unsubscribe(sample_person, sample_person)
85
85
 
86
86
Make sure that whenever the view actions is modified, this test
87
87
requires update: