~divmod-dev/divmod.org/lsbranch-1195

« back to all changes in this revision

Viewing changes to Mantissa/xmantissa/test/test_password_reset.py

  • Committer: glyph
  • Date: 2007-12-03 04:10:23 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:14436
Re-merge site-store theme changes after correcting for a poorly-written test.

Author: glyph

Reviewer: moe

Fixes #2413

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from xmantissa import signup
13
13
from xmantissa.website import WebSite
14
14
from xmantissa.port import SSLPort
15
 
from xmantissa.publicweb import _getLoader
16
15
from xmantissa.prefs import PreferenceAggregator
17
16
from xmantissa.webapp import PrivateApplication
18
17
from xmantissa.signup import PasswordResetResource, _PasswordResetAttempt
 
18
from xmantissa.offering import installOffering
 
19
from xmantissa.plugins.baseoff import baseOffering
19
20
 
20
21
 
21
22
class PasswordResetTestCase(TestCase):
24
25
        Set up a fake objects and methods for the password reset tests.
25
26
        """
26
27
        store = Store()
27
 
        self.loginSystem = userbase.LoginSystem(store=store)
 
28
        installOffering(store, baseOffering, {})
 
29
        self.loginSystem = store.findUnique(userbase.LoginSystem)
28
30
        la = self.loginSystem.addAccount(
29
31
            u'joe', u'divmod.com', u'secret', internal=True)
30
32
 
63
65
        self.substore = substore
64
66
        self.loginAccount = la
65
67
        self.nonExternalAccount = account
66
 
        signup._getLoader = lambda store, fragmentName: loaders.xmlstr('<html />')
67
68
        self.reset = PasswordResetResource(self.store)
68
69
 
69
70
 
70
 
    def tearDown(self):
71
 
        """
72
 
        Put things back the way they were.
73
 
        """
74
 
        signup._getLoader = _getLoader
75
 
 
76
 
 
77
71
    def test_reset(self):
78
72
        """
79
73
        Test a password reset, as it might happen for a user