Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
blog
Commits
0e9f94ed3b8c
Commit
0e9f94ed3b8c
authored
14 years ago
by
Sylvain Thénault
Browse files
Options
Downloads
Plain Diff
merge
parents
be454372d12a
c4013c0b4b8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/unittest_blog.py
+5
-9
5 additions, 9 deletions
test/unittest_blog.py
with
5 additions
and
9 deletions
test/unittest_blog.py
+
5
−
9
View file @
0e9f94ed
"""
Blog unit tests
"""
"""
Blog unit tests
"""
import
re
...
@@ -3,4 +2,4 @@
...
@@ -3,4 +2,4 @@
from
logilab.common.testlib
import
unittest_main
,
mock_object
from
logilab.common.testlib
import
unittest_main
from
cubicweb.devtools.testlib
import
CubicWebTC
,
MAILBOX
from
cubicweb.devtools.testlib
import
CubicWebTC
,
MAILBOX
...
@@ -5,12 +4,8 @@
...
@@ -5,12 +4,8 @@
from
cubicweb.devtools.testlib
import
CubicWebTC
,
MAILBOX
from
cubicweb.devtools.testlib
import
CubicWebTC
,
MAILBOX
from
email.Header
import
decode_header
from
cubicweb.sobjects.notification
import
RenderAndSendNotificationView
from
cubicweb.server.hookhelper
import
SendMailOp
class
BlogTestsCubicWebTC
(
CubicWebTC
):
class
BlogTestsCubicWebTC
(
CubicWebTC
):
"""
test blog specific behaviours
"""
"""
test blog specific behaviours
"""
def
test_notifications
(
self
):
def
test_notifications
(
self
):
req
=
self
.
request
()
req
=
self
.
request
()
...
@@ -11,8 +6,9 @@
...
@@ -11,8 +6,9 @@
class
BlogTestsCubicWebTC
(
CubicWebTC
):
class
BlogTestsCubicWebTC
(
CubicWebTC
):
"""
test blog specific behaviours
"""
"""
test blog specific behaviours
"""
def
test_notifications
(
self
):
def
test_notifications
(
self
):
req
=
self
.
request
()
req
=
self
.
request
()
cubicweb_blog
=
req
.
create_entity
(
'
Blog
'
,
title
=
u
'
cubicweb
'
,
description
=
u
"
cubicweb c
'
est beau
"
)
cubicweb_blog
=
req
.
create_entity
(
'
Blog
'
,
title
=
u
'
cubicweb
'
,
description
=
u
"
cubicweb c
'
est beau
"
)
blog_entry_1
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
hop
"
,
content
=
u
"
cubicweb hop
"
)
blog_entry_1
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
hop
"
,
content
=
u
"
cubicweb hop
"
)
...
@@ -18,3 +14,3 @@
...
@@ -18,3 +14,3 @@
blog_entry_1
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
hop
"
,
content
=
u
"
cubicweb hop
"
)
blog_entry_1
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
hop
"
,
content
=
u
"
cubicweb hop
"
)
self
.
execute
(
'
SET E entry_of B WHERE B eid %(beid)s, E eid %(eeid)s
'
%
{
'
beid
'
:
cubicweb_blog
.
eid
,
'
eeid
'
:
blog_entry_1
.
eid
}
)
blog_entry_1
.
set_relations
(
entry_of
=
cubicweb_blog
)
blog_entry_2
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
yes
"
,
content
=
u
"
cubicweb yes
"
)
blog_entry_2
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
yes
"
,
content
=
u
"
cubicweb yes
"
)
...
@@ -20,5 +16,5 @@
...
@@ -20,5 +16,5 @@
blog_entry_2
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
yes
"
,
content
=
u
"
cubicweb yes
"
)
blog_entry_2
=
req
.
create_entity
(
'
BlogEntry
'
,
title
=
u
"
yes
"
,
content
=
u
"
cubicweb yes
"
)
self
.
execute
(
'
SET E entry_of B WHERE B eid %(beid)s, E eid %(eeid)s
'
%
{
'
beid
'
:
cubicweb_blog
.
eid
,
'
eeid
'
:
blog_entry_2
.
eid
}
)
blog_entry_2
.
set_relations
(
entry_of
=
cubicweb_blog
)
self
.
assertEquals
(
len
(
MAILBOX
),
0
)
self
.
assertEquals
(
len
(
MAILBOX
),
0
)
self
.
commit
()
self
.
commit
()
self
.
assertEquals
(
len
(
MAILBOX
),
0
)
self
.
assertEquals
(
len
(
MAILBOX
),
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment