# Path: users/models.py
# class UserProfile(models.Model):
#     """Was here to manage m2m relation to Organization."""
#     # Keeping this, because I'll store more information about users at some point.
#     user = models.OneToOneField(User)
# 
# Path: development_resources/lorem_ipsum.py
# def get_paragraph(num_lines):
# def get_paragraphs(num_paragraphs):
# def get_words(num_words):


import os
from random import randint
from django.contrib.auth.models import User
from django.db import IntegrityError
from competencies.models import *
from users.models import UserProfile
from development_resources import lorem_ipsum as li
        print("Created superuser %s." % su_username)
    except IntegrityError:
        print('The user %s already exists.' % su_username)
        su = User.objects.filter(username=su_username)[0]

    try:
        ru = User.objects.create_user(username=ru_username,
                                      password=os.environ['RU_PASSWORD'])
        add_userprofile(ru)
        print("Created regular user %s." % ru_username)
    except IntegrityError:
        print('The user %s already exists.' % ru_username)
        ru = User.objects.filter(username=ru_username)[0]

def build_test_schools(num_elements=2):
    """Build a set of test schools for dev work."""

    # DEV: This is quite redundant with tests.test_views.setUp().
    #  If I keep this, that redundancy should be removed somehow.

    # Build an organization, down to the performance indicator level.
    num_elements = num_elements

    user = User.objects.filter(username=os.environ['RU_USERNAME'])[0]
    su_user = User.objects.filter(username=os.environ['SU_USERNAME'])[0]

    # Build num_elements test organizations that user 0 is associated with,
    #  num_elements the user 1 is associated with.
    test_organizations, test_sas = [], []
    for organization_num in range(6):

# Path: users/models.py
# class UserProfile(models.Model):
#     """Was here to manage m2m relation to Organization."""
#     # Keeping this, because I'll store more information about users at some point.
#     user = models.OneToOneField(User)
# 
# Path: development_resources/lorem_ipsum.py
# def get_paragraph(num_lines):
# def get_paragraphs(num_paragraphs):
# def get_words(num_words):


# Path: competencies/my_admin.py
import os
from random import randint
from django.contrib.auth.models import User
from django.db import IntegrityError
from competencies.models import *
from users.models import UserProfile
from development_resources import lorem_ipsum as li

        print("Created superuser %s." % su_username)
    except IntegrityError:
        print('The user %s already exists.' % su_username)
        su = User.objects.filter(username=su_username)[0]

    try:
        ru = User.objects.create_user(username=ru_username,
                                      password=os.environ['RU_PASSWORD'])
        add_userprofile(ru)
        print("Created regular user %s." % ru_username)
    except IntegrityError:
        print('The user %s already exists.' % ru_username)
        ru = User.objects.filter(username=ru_username)[0]

def build_test_schools(num_elements=2):
    """Build a set of test schools for dev work."""

    # DEV: This is quite redundant with tests.test_views.setUp().
    #  If I keep this, that redundancy should be removed somehow.

    # Build an organization, down to the performance indicator level.
    num_elements = num_elements

    user = User.objects.filter(username=os.environ['RU_USERNAME'])[0]
    su_user = User.objects.filter(username=os.environ['SU_USERNAME'])[0]

    # Build num_elements test organizations that user 0 is associated with,
    #  num_elements the user 1 is associated with.
    test_organizations, test_sas = [], []
    for organization_num in range(6):

        name = li.get_words(2)