These are chat archives for caep-unb/gestorpsi

17th
Sep 2015
Leandro Alves
@leandrokanis
Sep 17 2015 21:12
BOMBA!
Quando rodamos o test de authentication, dá erro no test de place
log:
./run_tests.sh
Creating test database for alias 'default'...
...........................F................E.......
======================================================================
ERROR: testLogin (gestorpsi.place.tests.ViewPlaceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/leandro/projetos/gestorpsi/gestorpsi/place/tests.py", line 130, in testLogin
    responseR = c.post('/accounts/register/',{"username":u'usermane',"city":u'1',"password2":u'password',"name":u'asd',"address_number":u'111',"password1":u'password',"zipcode":u'11111-111',"cpf":u'111.111.111-11',"phone":u'(11) 1111-11111',"state":u'1',"plan":u'1',"address":u'1111',"organization":u'asd',"shortname":u'asd',"email":u'asd@asd.com'})
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
    response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/test/client.py", line 262, in post
    return self.request(**r)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/leandro/projetos/gestorpsi/gestorpsi/authentication/views.py", line 243, in register
    form.save(request)
  File "/home/leandro/projetos/gestorpsi/gestorpsi/authentication/forms.py", line 127, in save
    organization = super(RegistrationForm, self).save(False, *args, **kwargs) # send_email = False
  File "/home/leandro/projetos/gestorpsi/gestorpsi/authentication/forms.py", line 60, in save
    profile.save()
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/db/models/base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/db/models/base.py", line 551, in save_base
    result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/db/models/manager.py", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/db/models/query.py", line 1592, in insert_query
    query.insert_values(fields, objs, raw=raw)
  File "/home/leandro/.virtualenvs/gestorpsi/local/lib/python2.7/site-packages/django/db/models/sql/subqueries.py", line 170, in insert_values
    value = getattr(obj, field.attname)
AttributeError: 'Profile' object has no attribute 'user_id'

======================================================================
FAIL: test_unicode (gestorpsi.authentication.tests.RoleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/leandro/projetos/gestorpsi/gestorpsi/authentication/tests.py", line 99, in test_unicode
    self.assertEquals(self.papel.__unicode__, saida)
AssertionError: <unbound method Role.__unicode__> != u"<class 'gestorpsi.authentication.models[106 chars]up'>"

----------------------------------------------------------------------
Ran 52 tests in 0.523s

FAILED (failures=1, errors=1)