Commit 718d9f6c authored by Florent Chehab's avatar Florent Chehab

bug corrected in user creation

parent 047ae66b
Pipeline #21972 passed with stages
in 3 minutes and 7 seconds
......@@ -28,4 +28,9 @@ To populate universities, also run in `./manage.py shell`:
%run ./rex/utils/insert_universities.py
```
Follow this tutorial : https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
\ No newline at end of file
Follow this tutorial : https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
in postgre
ALTER USER username CREATEDB;
GREATE DATABASE florent;
GRANT ALL on DATABASE florent to florent;
......@@ -97,20 +97,20 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.\
UserAttributeSimilarityValidator',
'NAME': 'django.contrib.auth.password_validation.'
'UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
MinimumLengthValidator',
'NAME': 'django.contrib.auth.password_validation.'
'MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
CommonPasswordValidator',
'NAME': 'django.contrib.auth.password_validation.'
'CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
NumericPasswordValidator',
'NAME': 'django.contrib.auth.password_validation.'
'NumericPasswordValidator',
},
]
......@@ -136,6 +136,7 @@ except KeyError:
dev_env = False
if dev_env:
print("You are running in development mode")
DEBUG = True
ALLOWED_HOSTS = []
SECRET_KEY = '0a1kbtt%as4624u*9+r+c%j1tlq&dc08==c3w604(4igc+t6tw'
......
from django.test import TestCase
from django.contrib.auth.models import User
from django.test.client import Client
class SuperUserTest(TestCase):
def setUp(self):
password = 'root'
self.my_admin = User.objects.create_superuser(
'myuser', 'myemail@test.com', password)
self.c = Client()
self.c.login(username=self.my_admin.username, password=password)
def test_created(self):
"""
Simple test to check if we can create a superuser. We had issues in the past.
"""
self.assertTrue(self.my_admin.is_superuser)
# Generated by Django 2.0.3 on 2018-04-23 09:44
# Generated by Django 2.0.3 on 2018-04-23 15:30
import django.core.validators
from django.db import migrations, models
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment