~allenap/maas/doc-for-other-modules

« back to all changes in this revision

Viewing changes to src/maasserver/tests/test_views_settings.py

  • Committer: Tarmac
  • Author(s): Gavin Panella
  • Date: 2013-03-07 15:21:43 UTC
  • mfrom: (1450.1.2 accounts-view-patterns)
  • Revision ID: tarmac-20130307152143-1kkj5szs3h1tnkuq
[r=rvb][bug=1151969][author=allenap] Ensure that all account views are routable by a full range of possible usernames.

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
        content_text = doc.cssselect('#content')[0].text_content()
375
375
        self.assertIn(user.username, content_text)
376
376
        self.assertIn(user.email, content_text)
 
377
 
 
378
    def test_account_views_are_routable_for_full_range_of_usernames(self):
 
379
        # Usernames can include characters in the regex [\w.@+-].
 
380
        user = factory.make_user(username="abc-123@example.com")
 
381
        for view in "edit", "view", "del":
 
382
            path = reverse("accounts-%s" % view, args=[user.username])
 
383
            self.assertIsInstance(path, (str, unicode))