Skip to content

Commit

Permalink
Merge pull request #16 from josemazo/master
Browse files Browse the repository at this point in the history
A pull-request with all the commits from @gabmunrio and me pushed till now.
Finally all the test pass. Good job, guys!
  • Loading branch information
versae committed Mar 4, 2014
2 parents 2ea8036 + 4fd5e28 commit be79e79
Show file tree
Hide file tree
Showing 92 changed files with 10,516 additions and 2,319 deletions.
18 changes: 11 additions & 7 deletions .travis.yml
@@ -1,16 +1,20 @@
language: python
python:
- "2.7"
env:
- NEO4J_VERSION="1.9.2"
before_install:
- ./download_and_install_neo4j.sh $NEO4J_VERSION
- ./neo4j/bin/neo4j start
install:
- pip install -U -r requirements.txt --use-mirrors
- pip install coveralls --use-mirrors
env:
- NEO4J_VERSION="1.9.2"
- pip install -r requirements_test.txt --use-mirrors
before_script:
- ./neo4j/bin/neo4j start
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- coverage run --source=sylva sylva/manage.py test accounts data engines graphs schemas
- coverage run --source=sylva sylva/manage.py test accounts base data engines graphs schemas
after_success:
- ./neo4j/bin/neo4j stop
- coveralls
after_script:
- ./neo4j/bin/neo4j stop
- "sh -e /etc/init.d/xvfb stop"
31 changes: 31 additions & 0 deletions .travis.yml.orig
@@ -0,0 +1,31 @@
language: python
python:
- "2.7"
env:
- NEO4J_VERSION="1.9.2"
before_install:
- ./download_and_install_neo4j.sh $NEO4J_VERSION
install:
<<<<<<< HEAD
- pip install -r requirements_test.txt --use-mirrors
before_script:
- ./neo4j/bin/neo4j start
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
=======
- pip install -U -r requirements_test.txt --use-mirrors
- pip install coveralls --use-mirrors
env:
global:
- NEO4J_VERSION="1.9.2"
matrix:
- INTERFACE="0"
- INTERFACE="1"
>>>>>>> gabmunrio/master
script:
- coverage run --source=sylva sylva/manage.py test accounts base data engines graphs schemas
after_success:
- coveralls
after_script:
- ./neo4j/bin/neo4j stop
- "sh -e /etc/init.d/xvfb stop"
3 changes: 2 additions & 1 deletion requirements.txt
Expand Up @@ -22,7 +22,8 @@ neo4jrestclient==1.7.0
psycopg2==2.4.5
pyblueprints==0.5.1
pycrypto==2.6
pydkim==0.3
# pydkim==0.3
git+git://github.com/ghewgill/pydkim.git
python-dateutil==2.1
python-rexster==0.1.1
requests==0.14.2
Expand Down
41 changes: 41 additions & 0 deletions requirements_test.txt
@@ -0,0 +1,41 @@
Django==1.4.2
Parsley==1.1
Pillow==1.7.8
PyYAML==3.10
South==0.7.6
argparse==1.2.1
boto==2.8.0
coverage==3.7
coveralls==0.3
django-guardian==1.0.4
django-maintenancemode==0.10
django-picklefield==0.2.1
django-s3-folder-storage==0.1
django-ses==0.4.1
django-storages==1.1.5
django-su==0.2
django-tinymce==1.5.1b4
django-userena==1.1.2
git+git://github.com/Yaco-Sistemas/django-zebra.git
docopt==0.6.1
easy-thumbnails==1.1
httplib2==0.7.7
ipdb==0.7
ipython==0.13.1
lucene-querybuilder==0.1.5
neo4jrestclient==1.7.0
psycopg2==2.4.5
pyblueprints==0.5.1
pycrypto==2.6
git+git://github.com/ghewgill/pydkim.git
python-dateutil==2.1
python-rexster==0.1.1
requests==2.0.1
selenium==2.37.2
sh==1.09
simplejson==2.6.2
six==1.2.0
splinter==0.5.4
stripe==1.7.8
ujson==1.23
wsgiref==0.1.2
45 changes: 45 additions & 0 deletions requirements_test.txt.orig
@@ -0,0 +1,45 @@
Django==1.4.2
Parsley==1.1
Pillow==1.7.8
PyYAML==3.10
South==0.7.6
argparse==1.2.1
boto==2.8.0
coverage==3.7
coveralls==0.3
django-guardian==1.0.4
django-maintenancemode==0.10
django-picklefield==0.2.1
django-s3-folder-storage==0.1
django-ses==0.4.1
django-storages==1.1.5
django-su==0.2
django-tinymce==1.5.1b4
django-userena==1.1.2
git+git://github.com/Yaco-Sistemas/django-zebra.git
docopt==0.6.1
easy-thumbnails==1.1
httplib2==0.7.7
ipdb==0.7
ipython==0.13.1
lucene-querybuilder==0.1.5
neo4jrestclient==1.7.0
psycopg2==2.4.5
pyblueprints==0.5.1
pycrypto==2.6
<<<<<<< HEAD
=======
# pydkim==0.3
>>>>>>> gabmunrio/master
git+git://github.com/ghewgill/pydkim.git
python-dateutil==2.1
python-rexster==0.1.1
requests==2.0.1
selenium==2.37.2
sh==1.09
simplejson==2.6.2
six==1.2.0
splinter==0.5.4
stripe==1.7.8
ujson==1.23
wsgiref==0.1.2
11 changes: 11 additions & 0 deletions sylva/accounts/forms.py
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
import datetime

from django import forms
from userena.forms import EditProfileForm


Expand All @@ -8,3 +11,11 @@ def __init__(self, *args, **kwargs):
super(UserProfileEditForm, self).__init__(*args, **kwargs)
for field_name in ["account", "options", "privacy"]:
del self.fields[field_name]

def clean_birth_date(self):
birth_date = self.cleaned_data["birth_date"]
today = datetime.date.today()
if birth_date > today:
raise forms.ValidationError("You need to introduce a past date.")
else:
return birth_date
6 changes: 3 additions & 3 deletions sylva/accounts/migrations/0001_initial.py
Expand Up @@ -33,7 +33,7 @@ def forwards(self, orm):
('location', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
('birth_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
('about_me', self.gf('django.db.models.fields.TextField')(blank=True)),
('instituion', self.gf('django.db.models.fields.CharField')(max_length=150, null=True, blank=True)),
('institution', self.gf('django.db.models.fields.CharField')(max_length=150, null=True, blank=True)),
('company', self.gf('django.db.models.fields.CharField')(max_length=150, null=True, blank=True)),
('lab', self.gf('django.db.models.fields.CharField')(max_length=150, null=True, blank=True)),
('options', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
Expand Down Expand Up @@ -72,7 +72,7 @@ def backwards(self, orm):
'company': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
'gender': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instituion': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
'institution': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
'lab': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '5'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
Expand Down Expand Up @@ -120,4 +120,4 @@ def backwards(self, orm):
}
}

complete_apps = ['accounts']
complete_apps = ['accounts']
2 changes: 1 addition & 1 deletion sylva/accounts/models.py
Expand Up @@ -51,7 +51,7 @@ class UserProfile(UserenaLanguageBaseProfile):
location = models.CharField(_('location'), max_length=255, blank=True)
birth_date = models.DateField(_('birth date'), blank=True, null=True)
about_me = models.TextField(_('about me'), blank=True)
instituion = models.CharField(_('instituion'), blank=True, null=True,
institution = models.CharField(_('institution'), blank=True, null=True,
max_length=150)
company = models.CharField(_('company'), blank=True, null=True,
max_length=150)
Expand Down
24 changes: 15 additions & 9 deletions sylva/accounts/tests.py
@@ -1,4 +1,4 @@
#-*- coding:utf8 -*-
#-*- coding:utf-8 -*-

from django.test import TestCase
from django.contrib.auth.models import User
Expand Down Expand Up @@ -72,15 +72,21 @@ def test_account_deletion(self):
"""
Tests User and UserProfile deletion.
"""
self.user.is_active = False
self.user.save()
self.user_profile.delete()
user_id = self.user.id
user_profile_id = self.user_profile.id
self.user.delete()

try:
UserProfile.objects.get(id=self.user.id)
exist = True
User.objects.get(id=user_id)
exist_user = True
except User.DoesNotExist:
exist_user = False

try:
UserProfile.objects.get(id=user_profile_id)
exist_user_profile = True
except UserProfile.DoesNotExist:
exist = False
exist_user_profile = False

self.assertEquals(self.user.is_active, False)
self.assertEquals(exist, False)
self.assertEquals(exist_user, False)
self.assertEquals(exist_user_profile, False)

0 comments on commit be79e79

Please sign in to comment.