Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for REST api and membership application form via requestfactory/testclient #237

Open
rambo opened this issue Apr 23, 2017 · 2 comments

Comments

@rambo
Copy link
Member

rambo commented Apr 23, 2017

http://pytest-django.readthedocs.io/en/latest/helpers.html#rf-requestfactory

@rambo
Copy link
Member Author

rambo commented Apr 23, 2017

https://pypi.python.org/pypi/django-webtest and https://snakeycode.wordpress.com/2014/01/28/django-webtest-tips-and-gotchas/ are probably good reads for anyone continuing the test-writing

@rambo
Copy link
Member Author

rambo commented Apr 23, 2017

>       assert b'Apply for membership' in response.content                                                                            
E       assert b'Apply for membership' in b'<!DOCTYPE html>\n<html lang="en">\n    <head>\n        <meta charset="utf-8">\n        <me
ta http-equiv="x-ua-compat...v>\n    </form>\n</div>\n\n    </main>\n\n    <script src="/static/js/asylum.js"></script>\n    \n    </b
ody>\n</html>'                                                                                                                        
E        +  where b'<!DOCTYPE html>\n<html lang="en">\n    <head>\n        <meta charset="utf-8">\n        <meta http-equiv="x-ua-comp
at...v>\n    </form>\n</div>\n\n    </main>\n\n    <script src="/static/js/asylum.js"></script>\n    \n    </body>\n</html>' = <django
.template.response.TemplateResponse object at 0x7f03963c2e80>.content                                                                 
                                                                                                                                      
members/tests/test_application.py:21: AssertionError      

It seems localisation does something horrible to members/tests/test_application.py::test_get_application_form under codefresh CI because this test works when I'm running it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant