Giter Site home page Giter Site logo

Comments (12)

amadeu01 avatar amadeu01 commented on June 21, 2024

Could it be Travis CI? Or, do you want any specific CI ?

from perfil-politico.

cuducos avatar cuducos commented on June 21, 2024

Nothing specific at this moment ; )

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

Okay.

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

Hi again.

I did one really simple Travis.

Build

Which I simply run the tests as it was described on the readme. However, it raises


==================================== ERRORS ====================================
_______________ ERROR collecting candidates/tests/test_views.py ________________
ImportError while importing test module '/code/candidates/tests/test_views.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
candidates/tests/test_views.py:6: in <module>
    from candidates.models import Candidates
E   ModuleNotFoundError: No module named 'candidates.models'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.21 seconds ============================

I wonder if you could give me a hand on this.

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

To be clear, I just run:
docker-compose run --rm api pytest

from perfil-politico.

cuducos avatar cuducos commented on June 21, 2024

Many thanks, @amadeu01 – it looks like you've catch some lines that weren't updated after last change in the architecture. I've changed two lines and now tests are passing:

diff --git a/api/candidates/tests/test_views.py b/api/candidates/tests/test_views.py
index d44b26e..ee25b77 100644
--- a/api/candidates/tests/test_views.py
+++ b/api/candidates/tests/test_views.py
@@ -3,7 +3,7 @@ import json
 import pytest
 from mongoengine.errors import NotUniqueError
 
-from candidates.models import Candidates
+from models import Candidates
 
 
 @pytest.fixture
diff --git a/api/candidates/views.py b/api/candidates/views.py
index a58fd4d..9acc84d 100644
--- a/api/candidates/views.py
+++ b/api/candidates/views.py
@@ -4,7 +4,7 @@ from restless.dj import DjangoResource
 from restless.preparers import FieldsPreparer
 from restless.serializers import JSONSerializer
 
-from .models import Candidates
+from models.candidates import Candidates
 
 
 class CandidateResource(DjangoResource):

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

from perfil-politico.

cuducos avatar cuducos commented on June 21, 2024

Okay, I’ll keep on the travis script.

I would suggest you to incorporate these fixes in your PR. They are important to make sure the Travis CI is working as expected ; )

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

from perfil-politico.

amadeu01 avatar amadeu01 commented on June 21, 2024

@cuducos don’t you think that would be better to make those fixes on another PR?

from perfil-politico.

cuducos avatar cuducos commented on June 21, 2024

I think either way would be just fine.

from perfil-politico.

cuducos avatar cuducos commented on June 21, 2024

Working ; )

from perfil-politico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.