Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-wiki
Commits
bb82b468
Commit
bb82b468
authored
May 17, 2014
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests should reflect forced lowercase paths.
parent
b032b613
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wiki/tests/test_basic.py
+9
-9
No files found.
wiki/tests/test_basic.py
View file @
bb82b468
...
@@ -101,14 +101,14 @@ class WebClientTest(TestCase):
...
@@ -101,14 +101,14 @@ class WebClientTest(TestCase):
# revealed only by sequence of tests in some particular order
# revealed only by sequence of tests in some particular order
c
=
self
.
c
c
=
self
.
c
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
{
'title'
:
'Test cache'
,
'slug'
:
'
TestC
ache'
,
'content'
:
'Content 1'
})
{
'title'
:
'Test cache'
,
'slug'
:
'
testc
ache'
,
'content'
:
'Content 1'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
TestC
ache/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
testc
ache/'
}))
response
=
c
.
post
(
reverse
(
'wiki:delete'
,
kwargs
=
{
'path'
:
'
TestC
ache/'
}),
response
=
c
.
post
(
reverse
(
'wiki:delete'
,
kwargs
=
{
'path'
:
'
testc
ache/'
}),
{
'confirm'
:
'on'
,
'purge'
:
'on'
,
'revision'
:
'2'
})
{
'confirm'
:
'on'
,
'purge'
:
'on'
,
'revision'
:
'2'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
''
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
''
}))
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
{
'title'
:
'Test cache'
,
'slug'
:
'TestCache'
,
'content'
:
'Content 2'
})
{
'title'
:
'Test cache'
,
'slug'
:
'TestCache'
,
'content'
:
'Content 2'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
TestC
ache/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
testc
ache/'
}))
# test the cache
# test the cache
self
.
assertContains
(
self
.
get_by_path
(
'TestCache/'
),
'Content 2'
)
self
.
assertContains
(
self
.
get_by_path
(
'TestCache/'
),
'Content 2'
)
...
@@ -121,9 +121,9 @@ class WebClientTest(TestCase):
...
@@ -121,9 +121,9 @@ class WebClientTest(TestCase):
# verify the new article is added to article_list
# verify the new article is added to article_list
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
{
'title'
:
'Sub Article 1'
,
'slug'
:
'SubArticle1'
})
{
'title'
:
'Sub Article 1'
,
'slug'
:
'SubArticle1'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
SubA
rticle1/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
suba
rticle1/'
}))
self
.
assertContains
(
self
.
get_by_path
(
''
),
'Sub Article 1'
)
self
.
assertContains
(
self
.
get_by_path
(
''
),
'Sub Article 1'
)
self
.
assertContains
(
self
.
get_by_path
(
''
),
'
SubA
rticle1/'
)
self
.
assertContains
(
self
.
get_by_path
(
''
),
'
suba
rticle1/'
)
# verify the deleted article is removed from article_list
# verify the deleted article is removed from article_list
response
=
c
.
post
(
reverse
(
'wiki:delete'
,
kwargs
=
{
'path'
:
'SubArticle1/'
}),
response
=
c
.
post
(
reverse
(
'wiki:delete'
,
kwargs
=
{
'path'
:
'SubArticle1/'
}),
{
'confirm'
:
'on'
,
'purge'
:
'on'
,
'revision'
:
'3'
})
{
'confirm'
:
'on'
,
'purge'
:
'on'
,
'revision'
:
'3'
})
...
@@ -145,12 +145,12 @@ class WebClientTest(TestCase):
...
@@ -145,12 +145,12 @@ class WebClientTest(TestCase):
c
=
self
.
c
c
=
self
.
c
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
{
'title'
:
'Level 1'
,
'slug'
:
'Level1'
,
'content'
:
'Content level 1'
})
{
'title'
:
'Level 1'
,
'slug'
:
'Level1'
,
'content'
:
'Content level 1'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
L
evel1/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
l
evel1/'
}))
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
'Level1/'
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
'Level1/'
}),
{
'title'
:
'test'
,
'slug'
:
'Test'
,
'content'
:
'Content on level 2'
})
{
'title'
:
'test'
,
'slug'
:
'Test'
,
'content'
:
'Content on level 2'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
Level1/T
est/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
level1/t
est/'
}))
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
response
=
c
.
post
(
reverse
(
'wiki:create'
,
kwargs
=
{
'path'
:
''
}),
{
'title'
:
'test'
,
'slug'
:
'Test'
,
'content'
:
'Other content on level 1'
})
{
'title'
:
'test'
,
'slug'
:
'Test'
,
'content'
:
'Other content on level 1'
})
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
T
est/'
}))
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'
t
est/'
}))
self
.
assertContains
(
self
.
get_by_path
(
'Test/'
),
'Other content on level 1'
)
self
.
assertContains
(
self
.
get_by_path
(
'Test/'
),
'Other content on level 1'
)
self
.
assertContains
(
self
.
get_by_path
(
'Level1/Test/'
),
'Content'
)
# on level 2')
self
.
assertContains
(
self
.
get_by_path
(
'Level1/Test/'
),
'Content'
)
# on level 2')
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment