Merge branch 'Qwann/SmallFixes' into Qwann/Serializers
This commit is contained in:
commit
e1f8a84111
4 changed files with 23 additions and 35 deletions
21
event/migrations/0002_auto_20170723_1419.py
Normal file
21
event/migrations/0002_auto_20170723_1419.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.3 on 2017-07-23 14:19
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('event', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='activity',
|
||||||
|
name='parent',
|
||||||
|
field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='event.ActivityTemplate'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -166,6 +166,7 @@ class Activity(AbstractActivityTemplate):
|
||||||
parent = models.ForeignKey(
|
parent = models.ForeignKey(
|
||||||
ActivityTemplate,
|
ActivityTemplate,
|
||||||
related_name="children",
|
related_name="children",
|
||||||
|
blank=True,
|
||||||
)
|
)
|
||||||
staff = models.ManyToManyField(
|
staff = models.ManyToManyField(
|
||||||
User,
|
User,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.3 on 2017-07-18 14:22
|
# Generated by Django 1.11.3 on 2017-07-23 14:14
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import django.contrib.auth.models
|
import django.contrib.auth.models
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
from django.test import TestCase, Client
|
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib.auth.models import User
|
|
||||||
|
|
||||||
|
|
||||||
class TestUserCreation(TestCase):
|
|
||||||
def test_create_view(self):
|
|
||||||
"""Create a user using the user creation form"""
|
|
||||||
user_data = {
|
|
||||||
"username": "MrsFoobar",
|
|
||||||
"first_name": "Baz",
|
|
||||||
"last_name": "Foobar",
|
|
||||||
"email": "baz@foobar.net",
|
|
||||||
}
|
|
||||||
|
|
||||||
data = user_data.copy()
|
|
||||||
data["password1"] = "4zwY5jdI"
|
|
||||||
data["password2"] = "4zwY5jdI"
|
|
||||||
data["key"] = settings.CREATE_USER_KEY
|
|
||||||
|
|
||||||
client = Client()
|
|
||||||
resp = client.post("/user/create/", data)
|
|
||||||
|
|
||||||
# The user redirection means successful form validation
|
|
||||||
self.assertRedirects(resp, "/")
|
|
||||||
|
|
||||||
# The user should now exist
|
|
||||||
user = (
|
|
||||||
User.objects
|
|
||||||
.filter(username=data["username"])
|
|
||||||
.values(*user_data.keys())
|
|
||||||
.get()
|
|
||||||
)
|
|
||||||
self.assertEqual(user_data, user)
|
|
Loading…
Add table
Reference in a new issue