mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 15:40:58 +00:00
1 line
6.2 KiB
JSON
1 line
6.2 KiB
JSON
[{"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299495207.492332, "message": "I have always found testing Django apps tricky, as many subsets of functionality involve elements hard to test e.g. email notifications, javascript functionality, ajax, etc...", "group_id": 81, "id": 286906}, {"user_id": 927, "stars": [], "topic_id": 11274, "date_created": 1299508722.7591619, "message": "One thing which might be useful is @ericholsher's testmaker (part of django-test-utils - see http://django-test-utils.readthedocs.org/en/latest/testmaker.html) which lets you browse through a site and generates tests which replay your activity. It's not a replacement for the full real browser tests and the tests can be noisy but it's great for e.g. walking a path in the admin and replaying it to make sure your customizations don't break in the future.", "group_id": 81, "id": 287909}, {"user_id": 927, "stars": [], "topic_id": 11274, "date_created": 1299508600.334094, "message": "I write tests for some core features - e.g. API methods, verifying email transmission, etc. - but once you start getting complex UI-heavy tests you really want to use something like Selenium or Windmill since any non-trivial AJAX UI is also going to need testing across multiple browsers", "group_id": 81, "id": 287899}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299509854.1352839, "message": "@acdha I'm curious but what is your method/technique for testing API and emails? :)", "group_id": 81, "id": 288062}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299511255.7628219, "message": "@carljm thanks for that!", "group_id": 81, "id": 288215}, {"user_id": 13524, "stars": [], "topic_id": 11274, "date_created": 1299510440.5559299, "message": "it's been there for a while", "group_id": 81, "id": 288134}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299509798.1454949, "message": "@acdha thank for the reply! I tried test-utils a while back for work, but it broke all my apps that depended on the `META` dict... as it strips that out of the request. :)", "group_id": 81, "id": 288044}, {"user_id": 13524, "stars": [], "topic_id": 11274, "date_created": 1299510083.600939, "message": "django has builtin support for testing emails, it catches them in an list which you can assert against (unit testing wise)", "group_id": 81, "id": 288089}, {"user_id": 13524, "stars": [], "topic_id": 11274, "date_created": 1299510099.267231, "message": "for ajaxy stuff selenium works quite nicely", "group_id": 81, "id": 288093}, {"user_id": 13524, "stars": [{"date_created": 1299713082.456969, "user_id": 5456}], "topic_id": 11274, "date_created": 1299510424.9140611, "message": "http://docs.djangoproject.com/en/dev/topics/testing/#e-mail-services", "group_id": 81, "id": 288133}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299510735.972218, "message": "@gudmundur interesting. Although I'm thinking more about testing emails while testing the app as a whole. What I mean is I usually send out email through signals, view method or by other means, and would like to test emails sent out in that context.", "group_id": 81, "id": 288143}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299510384.1280389, "message": "@gudmundur no way! Is the email thing really true?? Since what version has it been there?", "group_id": 81, "id": 288125}, {"user_id": 214, "stars": [{"date_created": 1299510969.6988659, "user_id": 18347}], "topic_id": 11274, "date_created": 1299510885.722331, "message": "Django doesn't provide specific support for that, but there are some nice Python mock libraries you can use. Personally I use http://pypi.python.org/pypi/mock by @voidspace - there's a comparison of various libraries at http://garybernhardt.github.com/python-mock-comparison/", "group_id": 81, "id": 288166}, {"user_id": 214, "stars": [], "topic_id": 11274, "date_created": 1299510761.505748, "message": "@jamespaxi It works fine for that.", "group_id": 81, "id": 288146}, {"user_id": 214, "stars": [], "topic_id": 11274, "date_created": 1299510821.428385, "message": "@jamespaxi And by \"API\" if you mean testing code that calls out to an external API, to test that you generally want to fake the external API calls with a stub that returns some hardcoded data you can test against.", "group_id": 81, "id": 288157}, {"user_id": 18347, "stars": [], "topic_id": 11274, "date_created": 1299511361.9987521, "message": "@carljm so for the emails what I am meant to do is create a unit test which would: iterate over the emails, recognize different types of emails, recognize what model instances are being used, compare model data with email data, check validity of urls provided ?", "group_id": 81, "id": 288227}, {"user_id": 214, "stars": [], "topic_id": 11274, "date_created": 1299511824.5657239, "message": "@jamespaxi Maybe? I mean, usually I would try to get the tests a bit more tightly targeted than that. I.e. a unit test that takes some action that ought to result in one email being sent, then check django.core.mail.outbox to make sure its length is 1, then check any other properties of the email you care about (destination, certain URL occurs in body text, ...).", "group_id": 81, "id": 288258}, {"user_id": 13524, "stars": [], "topic_id": 11274, "date_created": 1299511944.101259, "message": "@jamespaxi exactly what @carljm says... you want your unit tests to be isolated and as small as possible. Additionally you might add integration tests that actually make sure that you have a hole through the \"real\" mailing system.", "group_id": 81, "id": 288270}, {"user_id": 927, "stars": [], "topic_id": 11274, "date_created": 1299527863.1912279, "message": "I try for targeted tests at primitives (e.g. test your JSON API's filtering options) but then tend to use higher level integration tests for anything which involves large, outside black boxes like a browser", "group_id": 81, "id": 290341}, {"user_id": 281, "stars": [{"date_created": 1299713106.577359, "user_id": 5456}], "topic_id": 11274, "date_created": 1299707083.3188009, "message": "@jamespaxi The in-memory email backend is great for testing emails in unit tests http://docs.djangoproject.com/en/1.2/topics/email/#in-memory-backend", "group_id": 81, "id": 308692}] |