Fixed failing tests
This commit is contained in:
parent
0327d72f88
commit
27ff3a4ce6
|
@ -32,3 +32,4 @@ CELERY_ALWAYS_EAGER = True
|
||||||
########## END CELERY
|
########## END CELERY
|
||||||
|
|
||||||
# Your local stuff: Below this line define 3rd party library settings
|
# Your local stuff: Below this line define 3rd party library settings
|
||||||
|
API_AUTHENTICATION_REQUIRED = False
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
FROM python:3.5
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
|
||||||
|
|
||||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
|
||||||
COPY ./requirements.apt /requirements.apt
|
|
||||||
COPY ./install_os_dependencies.sh /install_os_dependencies.sh
|
|
||||||
RUN bash install_os_dependencies.sh install
|
|
||||||
COPY ./requirements /requirements
|
|
||||||
RUN pip install -r /requirements/base.txt
|
|
|
@ -1,12 +0,0 @@
|
||||||
FROM python:3.5
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
|
||||||
|
|
||||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
|
||||||
COPY ./requirements.apt /requirements.apt
|
|
||||||
COPY ./install_os_dependencies.sh /install_os_dependencies.sh
|
|
||||||
RUN bash install_os_dependencies.sh install
|
|
||||||
COPY ./requirements /requirements
|
|
||||||
RUN pip install -r /requirements/local.txt
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM funkwhale/apibase
|
FROM python:3.5
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
@ -6,8 +6,14 @@ ENV PYTHONUNBUFFERED 1
|
||||||
COPY ./requirements.apt /requirements.apt
|
COPY ./requirements.apt /requirements.apt
|
||||||
COPY ./install_os_dependencies.sh /install_os_dependencies.sh
|
COPY ./install_os_dependencies.sh /install_os_dependencies.sh
|
||||||
RUN bash install_os_dependencies.sh install
|
RUN bash install_os_dependencies.sh install
|
||||||
COPY ./requirements /requirements
|
|
||||||
|
RUN mkdir /requirements
|
||||||
|
|
||||||
|
COPY ./requirements/base.txt /requirements
|
||||||
|
RUN pip install -r /requirements/base.txt
|
||||||
|
COPY ./requirements/local.txt /requirements
|
||||||
RUN pip install -r /requirements/local.txt
|
RUN pip install -r /requirements/local.txt
|
||||||
|
COPY ./requirements/test.txt /requirements
|
||||||
RUN pip install -r /requirements/test.txt
|
RUN pip install -r /requirements/test.txt
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -50,7 +50,7 @@ class SessionRadio(SimpleRadio):
|
||||||
|
|
||||||
def filter_from_session(self, queryset):
|
def filter_from_session(self, queryset):
|
||||||
already_played = self.session.session_tracks.all().values_list('track', flat=True)
|
already_played = self.session.session_tracks.all().values_list('track', flat=True)
|
||||||
queryset = queryset.exclude(pk__in=already_played)
|
queryset = queryset.exclude(pk__in=list(already_played))
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
def pick(self, **kwargs):
|
def pick(self, **kwargs):
|
||||||
|
|
|
@ -74,12 +74,11 @@ class TestRadios(TestCase):
|
||||||
|
|
||||||
def test_can_use_radio_session_to_filter_choices(self):
|
def test_can_use_radio_session_to_filter_choices(self):
|
||||||
tracks = mommy.make('music.Track', _quantity=30)
|
tracks = mommy.make('music.Track', _quantity=30)
|
||||||
|
|
||||||
radio = radios.RandomRadio()
|
radio = radios.RandomRadio()
|
||||||
session = radio.start_session(self.user)
|
session = radio.start_session(self.user)
|
||||||
|
|
||||||
for i in range(30):
|
for i in range(30):
|
||||||
radio.pick()
|
p = radio.pick()
|
||||||
|
|
||||||
# ensure 30 differents tracks have been suggested
|
# ensure 30 differents tracks have been suggested
|
||||||
tracks_id = [session_track.track.pk for session_track in session.session_tracks.all()]
|
tracks_id = [session_track.track.pk for session_track in session.session_tracks.all()]
|
||||||
|
|
|
@ -7,6 +7,6 @@ coverage==4.0.3
|
||||||
django_coverage_plugin==1.1
|
django_coverage_plugin==1.1
|
||||||
flake8==2.5.0
|
flake8==2.5.0
|
||||||
django-test-plus==1.0.11
|
django-test-plus==1.0.11
|
||||||
factory_boy==2.6.0
|
factory_boy>=2.8.1
|
||||||
model_mommy
|
model_mommy
|
||||||
tox
|
tox
|
||||||
|
|
|
@ -6,4 +6,3 @@ test:
|
||||||
- .:/app
|
- .:/app
|
||||||
environment:
|
environment:
|
||||||
- DJANGO_SETTINGS_MODULE=config.settings.test
|
- DJANGO_SETTINGS_MODULE=config.settings.test
|
||||||
- API_AUTHENTICATION_REQUIRED=False
|
|
||||||
|
|
Loading…
Reference in New Issue