Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
31dcda2b
Commit
31dcda2b
authored
1 year ago
by
grollicus
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 'production'
duration in schedule.xml See merge request
hub/hub!668
parents
f2ee9caf
d7d243f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/schedule.py
+1
-1
1 addition, 1 deletion
src/api/schedule.py
src/api/tests/schedule.py
+29
-1
29 additions, 1 deletion
src/api/tests/schedule.py
with
30 additions
and
2 deletions
src/api/schedule.py
+
1
−
1
View file @
31dcda2b
...
...
@@ -87,7 +87,7 @@ class ScheduleEncoder(json.JSONEncoder):
days
=
duration
.
days
hours
=
duration
.
seconds
//
3600
minutes
=
duration
.
seconds
//
60
minutes
=
(
duration
.
seconds
%
3600
)
//
60
if
days
:
return
f
"
{
days
}
:
{
hours
:
02
d
}
:
{
minutes
:
02
d
}
"
return
f
"
{
hours
:
02
d
}
:
{
minutes
:
02
d
}
"
...
...
This diff is collapsed.
Click to expand it.
src/api/tests/schedule.py
+
29
−
1
View file @
31dcda2b
...
...
@@ -22,7 +22,7 @@ class ScheduleTest(TestCase):
self
.
conf
.
save
()
self
.
conf
.
tracks
.
create
(
slug
=
'
community
'
,
name
=
'
Community
'
).
save
()
self
.
conf
.
tracks
.
create
(
slug
=
'
security
'
,
name
=
'
Security
'
).
save
()
self
.
assembly
=
Assembly
(
name
=
'
TestAssembly
'
,
slug
=
'
asmbly
'
,
conference
=
self
.
conf
)
self
.
assembly
=
Assembly
(
name
=
'
TestAssembly
'
,
slug
=
'
asmbly
'
,
conference
=
self
.
conf
,
state_assembly
=
Assembly
.
State
.
PLACED
)
self
.
assembly
.
save
()
self
.
room
=
Room
(
conference
=
self
.
conf
,
assembly
=
self
.
assembly
,
name
=
'
Foo Room
'
,
room_type
=
Room
.
RoomType
.
STAGE
)
self
.
room
.
save
()
...
...
@@ -261,6 +261,34 @@ class ScheduleTest(TestCase):
self
.
assertEqual
(
400
,
resp
.
status_code
,
f
'
Unexpected success result from POST:
{
resp
.
content
}
'
)
def
testScheduleExport
(
self
):
# TODO write this test. This just tests some duration formatting edge cases for now
r
=
self
.
assembly
.
rooms
.
create
(
conference
=
self
.
conf
,
name
=
'
Zelt
'
,
room_type
=
'
stage
'
)
ev1
=
Event
(
conference
=
self
.
conf
,
assembly
=
self
.
assembly
,
room
=
r
,
name
=
'
Example Event
'
,
is_public
=
True
,
schedule_start
=
self
.
conf
.
start
,
schedule_duration
=
timedelta
(
minutes
=
120
),
)
ev1
.
save
()
resp
=
self
.
client
.
get
(
reverse
(
'
api:conference-schedule
'
,
kwargs
=
{
'
conference
'
:
self
.
conf
.
slug
})
+
'
.xml
'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
content
=
ET
.
fromstring
(
resp
.
content
.
decode
(
'
utf-8
'
))
day1
,
*
remaining_days
=
content
.
findall
(
'
day
'
)
for
remaining_day
in
remaining_days
:
self
.
assertEqual
(
len
(
remaining_day
),
0
)
room
,
=
day1
event1
,
=
room
self
.
assertEqual
(
event1
.
findtext
(
'
title
'
),
ev1
.
name
)
self
.
assertEqual
(
event1
.
findtext
(
'
date
'
),
'
2020-12-27T01:23:45+01:00
'
)
self
.
assertEqual
(
event1
.
findtext
(
'
start
'
),
'
01:23
'
)
self
.
assertEqual
(
event1
.
findtext
(
'
duration
'
),
'
02:00
'
)
def
test_cache
(
self
):
event
=
Event
(
conference
=
self
.
conf
,
assembly
=
self
.
assembly
,
name
=
'
Example Event
'
,
is_public
=
False
)
event
.
save
()
...
...
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