dj-stripe: Tests Fail with Django 1.9

Tests fail with Django 1.9 meaning that all new Pull Requests will fail given that the current requirements_test.txt has django>=1.7 which will result in 1.9 being installed during the build.

Example build - https://travis-ci.org/pydanny/dj-stripe/jobs/94795855

I wish I knew how to fix this but itโ€™s a little over my head as to how these tests actually work. ๐Ÿ˜–

======================================================================
ERROR: test_change_sub_stripe_error (tests.test_views.ChangePlanViewTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.0/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/travis/build/pydanny/dj-stripe/tests/test_views.py", line 333, in test_change_sub_stripe_error
    self.assertIn("No such plan: test_id_3", response.context["form"].errors["__all__"])
KeyError: '__all__'
======================================================================
ERROR: test_post_new_sub_no_proration (tests.test_views.ChangePlanViewTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.0/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/travis/build/pydanny/dj-stripe/tests/test_views.py", line 273, in test_post_new_sub_no_proration
    self.assertIn("You must already be subscribed to a plan before you can change it.", response.context["form"].errors["__all__"])
KeyError: '__all__'
======================================================================
ERROR: test_post_no_card (tests.test_views.ConfirmFormViewTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.0/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/travis/build/pydanny/dj-stripe/tests/test_views.py", line 235, in test_post_no_card
    self.assertIn("Invalid source object:", response.context["form"].errors["__all__"])
KeyError: '__all__'

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 32 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Think i have that correct, thanks again

Ideally, you would set

STRIPE_LIVE_SECRET_KEY STRIPE_LIVE_PUBLIC_KEY STRIPE_TEST_SECRET_KEY STRIPE_TEST_PUBLIC_KEY STRIPE_LIVE_MODE

And populate them from the environment (hard-coding keys is bad practice)

@the-webguys with a capital F, yes ๐Ÿ˜‰

you are a legend, thank you

@the-webguys no worries! Weโ€™ve been slow to release the major version change.

pip install git+https://github.com/dj-stripe/dj-stripe.git@1.0.0