Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
urz-django
tuc2014
Commits
998decd5
Commit
998decd5
authored
Nov 08, 2021
by
Daniel Klaffenbach
🐍
Browse files
Drop legacy imports
This is required for Django 3.x+
parent
e58bbab1
Pipeline
#51616
failed with stage
in 11 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/tests.py
View file @
998decd5
...
...
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
from
django.contrib.auth.models
import
User
from
django.test
import
Client
,
TestCase
from
django.urls
import
reverse
from
django.utils
import
six
class
Tuc2014TestCase
(
TestCase
):
...
...
@@ -16,7 +15,7 @@ class Tuc2014TestCase(TestCase):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assertTrue
(
self
.
CONTENT_BLOCK
in
s
ix
.
text_type
(
response
.
content
,
"utf-8"
))
self
.
assertTrue
(
self
.
CONTENT_BLOCK
in
s
tr
(
response
.
content
,
"utf-8"
))
def
test_admin
(
self
):
user
=
User
.
objects
.
create_superuser
(
username
=
"test"
,
email
=
""
,
password
=
"test"
)
...
...
tests/urls.py
View file @
998decd5
from
django.
conf.
urls
import
url
from
django.urls
import
re_path
from
django.contrib
import
admin
from
.views
import
index
urlpatterns
=
[
url
(
r
'^$'
,
index
),
url
(
'admin/'
,
admin
.
site
.
urls
),
re_path
(
r
'^$'
,
index
),
re_path
(
'admin/'
,
admin
.
site
.
urls
),
]
...
...
tuc2014/context_processors.py
View file @
998decd5
...
...
@@ -2,11 +2,7 @@
from
__future__
import
unicode_literals
import
datetime
from
django.conf
import
settings
try
:
# Available in Django 1.10+
from
django.urls
import
reverse
except
ImportError
:
from
django.core.urlresolvers
import
reverse
from
django.urls
import
reverse
def
tucal
(
request
):
...
...
tuc2014/urls.py
View file @
998decd5
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.
conf.
urls
import
include
,
url
from
django.urls
import
include
,
re_path
from
.views
import
change_language
app_name
=
'tuc2014'
urlpatterns
=
[
url
(
r
'^i18n/'
,
include
((
'django.conf.urls.i18n'
,
'djangoi18n'
),
namespace
=
'djangoi18n'
)),
url
(
r
'^$'
,
change_language
,
name
=
'change_language'
)
re_path
(
r
'^i18n/'
,
include
((
'django.conf.urls.i18n'
,
'djangoi18n'
),
namespace
=
'djangoi18n'
)),
re_path
(
r
'^$'
,
change_language
,
name
=
'change_language'
)
]
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