Fix tests for tox

This commit is contained in:
ErikKalkoken 2020-06-25 23:38:20 +02:00
parent 580c8c19de
commit 7b9ddf90c1
3 changed files with 13 additions and 12 deletions

View File

@ -28,7 +28,7 @@
{% endif %}
{% if request.user.is_superuser %}
<div class="text-center" style="padding-top:5px;">
<a type="button" class="btn btn-default" href="{% url 'discord:add_bot' %}">
<a type="button" id="btnLinkDiscordServer" class="btn btn-default" href="{% url 'discord:add_bot' %}">
{% trans "Link Discord Server" %}
</a>
</div>

View File

@ -483,15 +483,16 @@ class TestUserFeatures(WebTest):
mock_exception.response.status_code = 440
requests_mocker.get(guild_infos_request.url, exc=mock_exception)
# login
superuser = User.objects.create_superuser(
"admin", "admin@example.com", "admin123"
)
AuthUtils.add_main_character_2(superuser, "my_main", 1099)
self.app.set_user(superuser)
# login
self.member.is_superuser = True
self.member.is_staff = True
self.member.save()
self.app.set_user(self.member)
# click deactivate on the service page
response = self.app.get(reverse('services:services'))
# check we got can see the page
# check we got can see the page and the "link server" button
self.assertEqual(response.status_int, 200)
self.assertIsNotNone(response.html.find(id='btnLinkDiscordServer'))

View File

@ -25,10 +25,10 @@ class ExampleService(ServicesHook):
:return:
"""
urls = self.Urls()
urls.auth_activate = 'auth_example_activate'
urls.auth_deactivate = 'auth_example_deactivate'
urls.auth_reset_password = 'auth_example_reset_password'
urls.auth_set_password = 'auth_example_set_password'
# urls.auth_activate = 'auth_example_activate'
# urls.auth_deactivate = 'auth_example_deactivate'
# urls.auth_reset_password = 'auth_example_reset_password'
# urls.auth_set_password = 'auth_example_set_password'
return render_to_string(self.service_ctrl_template, {
'service_name': self.title,
'urls': urls,