-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dacf27f
commit 8fdf569
Showing
2 changed files
with
22 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,25 @@ def test_version_url_with_caps(self): | |
kwargs={'type_': 'pdf', 'version_slug': u'1.4.X', 'project_slug': u'django'} | ||
) | ||
self.assertTrue(url) | ||
|
||
|
||
class TestProfileDetailURLs(TestCase): | ||
|
||
def test_profile_detail_url(self): | ||
url = reverse( | ||
'profiles_profile_detail', | ||
kwargs={'username': 'foo+bar'} | ||
) | ||
self.assertEqual(url, '/profiles/foo+bar/') | ||
|
||
url = reverse( | ||
'profiles_profile_detail', | ||
kwargs={'username': '[email protected]'} | ||
) | ||
self.assertEqual(url, '/profiles/[email protected]/') | ||
|
||
url = reverse( | ||
'profiles_profile_detail', | ||
kwargs={'username': 'abc-def+ghi'} | ||
) | ||
self.assertEqual(url, '/profiles/abc-def+ghi/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,30 +241,3 @@ def test_project_admins_can_delete_subprojects_that_they_are_not_admin_of(self): | |
'/dashboard/my-mainproject/subprojects/my-subproject/delete/') | ||
self.assertEqual(response.status_code, 302) | ||
self.assertTrue(self.subproject not in [r.child for r in self.project.subprojects.all()]) | ||
|
||
class URLResolution(TestCase): | ||
def setUp(self): | ||
self.user1 = new(User, username='foo+bar') | ||
self.user1.set_password('test1') | ||
self.user1.save() | ||
|
||
self.user2 = new(User, username='[email protected]') | ||
self.user2.set_password('test2') | ||
self.user2.save() | ||
|
||
self.user3 = new(User, username='abc-def+ghi') | ||
self.user3.set_password('test3') | ||
self.user3.save() | ||
|
||
self.client.login(username='foo+bar', password='test1') | ||
|
||
def test_profile_details_page(self): | ||
|
||
response = self.client.get('/profiles/foo+bar/') | ||
self.assertEqual(response.status_code, 200) | ||
|
||
response = self.client.get('/profiles/[email protected]/') | ||
self.assertEqual(response.status_code, 200) | ||
|
||
response = self.client.get('/profiles/abc-def+ghi/') | ||
self.assertEqual(response.status_code, 200) |