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
c971cb48
Commit
c971cb48
authored
May 20, 2014
by
benjaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mastak/django-wiki into mastak-master
Conflicts: wiki/tests/__init__.py
parents
d6cf63f8
6323f817
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
wiki/managers.py
+2
-8
wiki/tests/__init__.py
+1
-2
wiki/tests/test_basic.py
+7
-0
No files found.
wiki/managers.py
View file @
c971cb48
from
django.db
import
models
from
django.db.models
import
Q
from
django.db.models.query
import
QuerySet
,
EmptyQuerySet
from
mptt.managers
import
TreeManager
class
ArticleEmptyQuerySet
(
EmptyQuerySet
):
def
can_read
(
self
,
user
):
return
self
def
can_write
(
self
,
user
):
return
self
def
active
(
self
):
return
self
class
ArticleQuerySet
(
QuerySet
):
...
...
@@ -95,7 +89,7 @@ class ArticleFkEmptyQuerySet(ArticleFkEmptyQuerySetMixin, EmptyQuerySet):
class
ArticleManager
(
models
.
Manager
):
def
get_empty_query_set
(
self
):
return
ArticleEmptyQuerySet
(
model
=
self
.
model
)
return
self
.
get_query_set
()
.
none
(
)
def
get_query_set
(
self
):
return
ArticleQuerySet
(
self
.
model
,
using
=
self
.
_db
)
def
active
(
self
):
...
...
wiki/tests/__init__.py
View file @
c971cb48
from
.test_basic
import
*
\ No newline at end of file
from
.test_basic
import
*
wiki/tests/test_basic.py
View file @
c971cb48
...
...
@@ -154,3 +154,10 @@ class WebClientTest(TestCase):
self
.
assertRedirects
(
response
,
reverse
(
'wiki:get'
,
kwargs
=
{
'path'
:
'test/'
}))
self
.
assertContains
(
self
.
get_by_path
(
'Test/'
),
'Other content on level 1'
)
self
.
assertContains
(
self
.
get_by_path
(
'Level1/Test/'
),
'Content'
)
# on level 2')
def
test_empty_search
(
self
):
c
=
self
.
c
response
=
c
.
get
(
reverse
(
'wiki:search'
),
{
'q'
:
'Article'
})
self
.
assertContains
(
response
,
'Root Article'
)
response
=
c
.
get
(
reverse
(
'wiki:search'
),
{
'q'
:
''
})
self
.
assertFalse
(
response
.
context
[
'articles'
])
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