Travis build was failing with the localhost approach. Instead I created a
tests folder in the uploads folder (MEDIA_ROOT points to the uploads
folder) and I am using the absolute path to the images (generated using
python's os module). Will this still mean that we can only run the tests
locally?


On Thu, May 8, 2014 at 4:48 PM, Arthur <notifications@github.com> wrote:

> In harvardcards/apps/flash/tests.py:
>
> > @@ -124,9 +124,9 @@ def test_getDeckCardsList(self):
> >              CardTemplates_Fields.objects.create(card_template=card_template, field=f)
> >
> >          card_list = [
> > -            [{"field_id":field1.id,"value":"a"},{"field_id":field2.id,"value":"a"}],
> > -            [{"field_id":field1.id,"value":"bb"},{"field_id":field2.id,"value":"bb"}],
> > -            [{"field_id":field1.id,"value":"ccc"},{"field_id":field2.id,"value":"ccc"}],
> > +            [{"field_id":field1.id,"value":"a"},{"field_id":field2.id,"value":"http://www.columbia.edu/cu/arthistory/images/slideshow/Amiens.jpg"}],
> > +            [{"field_id":field1.id,"value":"bb"},{"field_id":field2.id,"value":"http://www.columbia.edu/cu/arthistory/images/slideshow/10310749545.jpg"}],
> > +            [{"field_id":field1.id,"value":"ccc"},{"field_id":field2.id,"value":"http://art.uga.edu/images/cache/ce_image/local/images/uploads/areas-of-study/overview/mfa_arthistory_overview_620_300auto_c1.jpg"}],
>
> We should change these links to local links so that we're not hitting the
> columbia.edu servers every time we run the tests. I'd suggest we create a
> static/tests directory where we can put some sample images. Then in the
> test itself, the link will look like
> http://localhost:8000/static/tests/my-test-image.jpg. The only issue with
> this change is that the test will only work if the local server is running,
> but at least it won't be hitting remote servers every time the tests are
> run.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Harvard-ATG/HarvardCards/pull/55/files#r12451682>
> .
>