mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Normally fixs tests
This commit is contained in:
parent
d14af8e452
commit
a284637190
@ -124,14 +124,6 @@ Welcome to the wiki page!
|
||||
skia.save()
|
||||
skia.view_groups=[Group.objects.filter(name=settings.SITH_MAIN_MEMBERS_GROUP).first().id]
|
||||
skia.save()
|
||||
# Adding user sli
|
||||
sli = User(username='sli', last_name="Li", first_name="S",
|
||||
email="sli@git.an",
|
||||
date_of_birth="1942-06-12")
|
||||
sli.set_password("plop")
|
||||
sli.save()
|
||||
skia.view_groups=[Group.objects.filter(name=settings.SITH_MAIN_MEMBERS_GROUP).first().id]
|
||||
sli.save()
|
||||
# Adding user public
|
||||
public = User(username='public', last_name="Not subscribed", first_name="Public",
|
||||
email="public@git.an",
|
||||
@ -229,14 +221,6 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
|
||||
duration=settings.SITH_SUBSCRIPTIONS[s.subscription_type]['duration'],
|
||||
start=s.subscription_start)
|
||||
s.save()
|
||||
## Sli
|
||||
s = Subscription(member=Subscriber.objects.filter(pk=sli.pk).first(), subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0])
|
||||
s.subscription_start = s.compute_start()
|
||||
s.subscription_end = s.compute_end(
|
||||
duration=settings.SITH_SUBSCRIPTIONS[s.subscription_type]['duration'],
|
||||
start=s.subscription_start)
|
||||
s.save()
|
||||
## Comptable
|
||||
s = Subscription(member=User.objects.filter(pk=comptable.pk).first(), subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0])
|
||||
@ -327,6 +311,22 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
|
||||
simple.save()
|
||||
woenzco = Company(name="Woenzel & co")
|
||||
woenzco.save()
|
||||
# Adding user sli
|
||||
sli = User(username='sli', last_name="Li", first_name="S",
|
||||
email="sli@git.an",
|
||||
date_of_birth="1942-06-12")
|
||||
sli.set_password("plop")
|
||||
sli.save()
|
||||
skia.view_groups=[Group.objects.filter(name=settings.SITH_MAIN_MEMBERS_GROUP).first().id]
|
||||
sli.save()
|
||||
## Adding subscription for sli
|
||||
s = Subscription(member=User.objects.filter(pk=sli.pk).first(), subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0])
|
||||
s.subscription_start = s.compute_start()
|
||||
s.subscription_end = s.compute_end(
|
||||
duration=settings.SITH_SUBSCRIPTIONS[s.subscription_type]['duration'],
|
||||
start=s.subscription_start)
|
||||
s.save()
|
||||
|
||||
operation_list = [
|
||||
(27, "J'avais trop de bière", 'CASH', None, buying, 'USER', skia.id, "", None),
|
||||
@ -349,10 +349,10 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
|
||||
operation.save()
|
||||
|
||||
# Create an election
|
||||
el = Election(title="Élection 2017", description="La roue tourne", start_proposal='1942-06-12 10:28:45', end_proposal='2042-06-12 10:28:45',start_date='1942-06-12 10:28:45', end_date='7942-06-12 10:28:45')
|
||||
el.save()
|
||||
resp = Responsability(election=el, title="Co Respo Info", description="Ghetto++")
|
||||
resp.save()
|
||||
cand = Candidate(responsability=resp, user=skia)
|
||||
cand.save()
|
||||
# el = Election(title="Élection 2017", description="La roue tourne", start_proposal='1942-06-12 10:28:45', end_proposal='2042-06-12 10:28:45',start_date='1942-06-12 10:28:45', end_date='7942-06-12 10:28:45')
|
||||
# el.save()
|
||||
# resp = Responsability(election=el, title="Co Respo Info", description="Ghetto++")
|
||||
# resp.save()
|
||||
# cand = Candidate(responsability=resp, user=skia)
|
||||
# cand.save()
|
||||
|
||||
|
@ -13,10 +13,11 @@ class Migration(migrations.Migration):
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Candidate',
|
||||
name='Candidature',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('program', models.TextField(blank=True, null=True, verbose_name='description')),
|
||||
('has_voted', models.ManyToManyField(related_name='has_voted', to=settings.AUTH_USER_MODEL, verbose_name='has_voted')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@ -25,38 +26,44 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255, verbose_name='title')),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='description')),
|
||||
('start_proposal', models.DateTimeField(verbose_name='start proposal')),
|
||||
('end_proposal', models.DateTimeField(verbose_name='end proposal')),
|
||||
('start_candidature', models.DateTimeField(verbose_name='start candidature')),
|
||||
('end_candidature', models.DateTimeField(verbose_name='end candidature')),
|
||||
('start_date', models.DateTimeField(verbose_name='start date')),
|
||||
('end_date', models.DateTimeField(verbose_name='end date')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Responsability',
|
||||
name='List',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255, verbose_name='title')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Role',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255, verbose_name='title')),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='description')),
|
||||
('election', models.ForeignKey(to='election.Election', verbose_name='election', related_name='responsability')),
|
||||
('election', models.ForeignKey(related_name='role', to='election.Election', verbose_name='election')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Vote',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('candidate', models.ManyToManyField(to='election.Candidate', related_name='vote', verbose_name='candidate')),
|
||||
('election', models.ForeignKey(to='election.Election', verbose_name='election', related_name='vote')),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='user', related_name='vote')),
|
||||
('candidature', models.ManyToManyField(related_name='vote', to='election.Candidature', verbose_name='candidature')),
|
||||
('role', models.ForeignKey(related_name='vote', to='election.Role', verbose_name='role')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
name='responsability',
|
||||
field=models.ForeignKey(to='election.Responsability', verbose_name='responsability', related_name='candidate'),
|
||||
model_name='candidature',
|
||||
name='role',
|
||||
field=models.ForeignKey(related_name='candidature', to='election.Role', verbose_name='role'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
model_name='candidature',
|
||||
name='user',
|
||||
field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='user', related_name='candidate'),
|
||||
field=models.ForeignKey(blank=True, related_name='candidate', to=settings.AUTH_USER_MODEL, verbose_name='user'),
|
||||
),
|
||||
]
|
||||
|
@ -5,8 +5,6 @@ from django.conf import settings
|
||||
|
||||
from datetime import timedelta
|
||||
from core.models import User
|
||||
from subscription.models import Subscriber
|
||||
from subscription.views import get_subscriber
|
||||
|
||||
|
||||
class Election(models.Model):
|
||||
@ -66,7 +64,7 @@ class List(models.Model):
|
||||
"""
|
||||
To allow per list vote
|
||||
"""
|
||||
title = models.CharField(_('title'))
|
||||
title = models.CharField(_('title'), max_length=255)
|
||||
|
||||
|
||||
class Vote(models.Model):
|
||||
|
@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.conf import settings
|
||||
|
||||
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin
|
||||
from election.models import Election, Responsability, Candidate
|
||||
from election.models import Election, Role, Candidature
|
||||
|
||||
# Display elections
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user