EUDAT-B2NOTE / b2note

B2NOTE is a EUDAT pilot service allowing users to "annotate" semantically a document.
https://b2note.bsc.es
MIT License
4 stars 9 forks source link

Unit-test not working - refactor and split #364

Closed TomasKulhanek closed 5 years ago

TomasKulhanek commented 5 years ago

Unit-test are not working. This prevents from properly test potential upgrade to Python 3 and Django and other libraries/frameworks. Executing manage.py test fails on auth failed

TomasKulhanek commented 5 years ago

test authentication fails for testcases

user = django.contrib.auth.authenticate(email=self.email,password=self.password)

fails internally on

Unable to display children:Error resolving variables Traceback (most recent call last):
  File "/home/vagrant/py3/lib64/python3.6/site-packages/django/contrib/auth/__init__.py", line 68, in authenticate
    inspect.getcallargs(backend.authenticate, request, **credentials)
  File "/usr/lib64/python3.6/inspect.py", line 1344, in getcallargs
    (f_name, kw))
TypeError: authenticate() got multiple values for argument 'email'

cause is that the position argument is expected to be email, and set 'None' by default. Second 'email' named argument is provided with value. Workaround (fix):

user = django.contrib.auth.authenticate(self.email,password=self.password) 
TomasKulhanek commented 5 years ago

Fixed by major refactor/upgrade and update