Commit graph

3734 commits

Author SHA1 Message Date
Ole Laursen d5b14f3fb3 Rewrite meeting tests: add fake data generator, rewrite the
SimpleUrlTest tests to work with fake data and expand them a bit (they
are still pretty basic), rewrite the agenda editing tests to work with
the small generated fake data, delete those tests that are trivial or
only testing fixture facts as opposed to actually exercising the code,
combine some of them, expand most to actually check the returned JSON
and generally clean up the copy-paste mess of incorrect comments and
incorrect POST data.

At this point, no tests are using the real data base test machinery,
so one can run the full test suite with just

  python manage.py test --settings=settings_sqlitetest

This takes about 72 seconds one a 2.4 GHz Intel Core 2. The
test-crawler and other real data tests take somewhat longer, though.
 - Legacy-Id: 7069
2013-12-24 16:09:33 +00:00
Ole Laursen 3408b73872 Use request.POST directly instead of aliasing it to update_dict, add a
FIXME on permission naming
 - Legacy-Id: 7068
2013-12-24 15:59:01 +00:00
Ole Laursen f8b1568c87 Rewrite meeting PUTs to POSTs. For no apparent reason, parts of the
meeting AJAX code is using PUT instead of POST (even if it's not
PUT'ing in the literal sense but POST'ing). Theoretical discussions
aside, Django has poor support for PUTs turned POSTs so rewriting them
removes the need for a couple of hacks, and makes it easier to test.
 - Legacy-Id: 7067
2013-12-24 15:13:33 +00:00
Ole Laursen 083b3138c6 Rename group AJAX URL parameter to acronym instead of groupname since
it is in fact the acronym, not the name of the group
 - Legacy-Id: 7064
2013-12-24 12:49:25 +00:00
Ole Laursen c098fb4f07 Regularize meeting_json to take num instead of meeting_num like the
other meeting AJAX views
 - Legacy-Id: 7060
2013-12-23 17:19:49 +00:00
Ole Laursen 77bd8772b5 Fix interesting syntax error in group_session_mapping, += was mistyped
as =+ which is legal (assignment followed by unary +)
 - Legacy-Id: 7059
2013-12-23 16:59:21 +00:00
Ole Laursen b4fa414406 Make agenda_permission use user_is_person, rewrite it to be a little
less verbose
 - Legacy-Id: 7054
2013-12-23 16:43:44 +00:00
Ole Laursen e69ba1e8c4 Fix spelling mistakes in comments for Constraint
- Legacy-Id: 7053
2013-12-23 16:08:36 +00:00
Ole Laursen b42a1165d7 Use .first() and prevent an extra .count() query in TimeSlot.session
- Legacy-Id: 7052
2013-12-23 15:40:10 +00:00
Ole Laursen 7dc534f325 Add a couple of select_related fields to edit_timeslots to reduce
number of DB queries from 400 to 13
 - Legacy-Id: 7051
2013-12-23 13:25:22 +00:00
Ole Laursen d6d80a4a77 Make a couple of the utility methods in meeting.models use .first(),
fix potential bug in slot_to_the_right, test on location_id instead of
location in build_timeslices to speed up the edit timeslots view
 - Legacy-Id: 7050
2013-12-23 13:24:40 +00:00
Ole Laursen a5f5eb84d3 With the new test discovery mechanism in Django 1.6 (inherited from
unittest2 in Python 2.7), manually importing tests from files starting
with test* will run them twice, so don't do that
 - Legacy-Id: 7030
2013-12-20 13:08:38 +00:00
Ole Laursen 3fa1834986 Remove Person.objects.by_username/by_email for now - they aren't actually in use, the email one looks suspicious in that it takes the email from the User object, and the username one does not seem generally useful; also remove the unit tests of these two which was relying on an incomplete fixture
- Legacy-Id: 7029
2013-12-20 12:13:02 +00:00
Ole Laursen fa489ce37a Upgrade Dajaxice to latest version from github (0.5.5) to make meeting agenda code work with CSRF, with url conf import fix and using json instead of deprecated simplejson from Django - add a simple view to serve dajaxice.core.js which we need because we are not using the staticfiles collection step (apparently Dajaxice hooks into that through a somewhat complicated hack)
- Legacy-Id: 7028
2013-12-20 11:59:09 +00:00
Ole Laursen 88860edba4 Use user_is_person to determine whether user is schedule owner in
agenda AJAX, instead of complicated try except
 - Legacy-Id: 7027
2013-12-20 11:55:25 +00:00
Ole Laursen fdb6baf4e6 Use collections.OrderedDict instead of the SortedDict bundled with Django
- Legacy-Id: 7026
2013-12-20 11:00:07 +00:00
Ole Laursen 38c153c03d Remove usage of distinct(field) in meeting/helpers.py, Django
complains that it doesn't work on MySQL and the two uses appear
superfluous anyway since they only return the field being distincted
 - Legacy-Id: 7018
2013-12-19 16:06:37 +00:00
Ole Laursen 2cc2323b06 Speed up IPR list by adding a prefetch_related() call
- Legacy-Id: 7017
2013-12-19 11:53:41 +00:00
Ole Laursen defb116721 Use prefetch_related to reduce the number of queries on the search page and in idindex generation, adjust a couple of members on Document slightly to not filter on relations (filtering doesn't work with prefetch_related)
- Legacy-Id: 6992
2013-12-18 16:58:34 +00:00
Ole Laursen a656cf8a8b Add .prefetch_related on liaison list page to reduce the number of DB
queries (from 571 to 28)
 - Legacy-Id: 6991
2013-12-18 16:30:18 +00:00
Ole Laursen cb4d5b7c2b Simplify make_test_data a bit by using the create_person helper for the chair and WG delegate, regularize the naming of those
- Legacy-Id: 6990
2013-12-18 16:27:02 +00:00
Ole Laursen 81e032b9e4 Remove unnecessary escapes from another bunch of templates
- Legacy-Id: 6989
2013-12-18 16:10:47 +00:00
Ole Laursen 23725f781c Port secr/drafts/report_id_activity.py away from setup_environ too
- Legacy-Id: 6988
2013-12-18 16:02:04 +00:00
Ole Laursen f02f2ccbfc Regenerate name fixtures, apparently the indentation of the JSON output has changed
- Legacy-Id: 6987
2013-12-18 15:53:15 +00:00
Ole Laursen e54bd17499 Port from django.core.management.setup_environ to DJANGO_SETTINGS_MODULE
- Legacy-Id: 6985
2013-12-18 15:51:11 +00:00
Ole Laursen f88fb5f9ac Port meeting fix from shimfree branch
- Legacy-Id: 6984
2013-12-18 14:56:37 +00:00
Ole Laursen b72742764f Set ALLOWED_HOSTS (may need some tweaking), add LOGGING setting to
enable HTML exception emails to compensate for not carrying the HTML
patch that was applied to Django 1.2
 - Legacy-Id: 6982
2013-12-18 14:00:44 +00:00
Ole Laursen cf61f2b59b Remove a bunch of unnecessary |escape filter calls, auto-escaping is enabled by default so manual escape is only necessary in few cases
- Legacy-Id: 6981
2013-12-18 13:38:13 +00:00
Ole Laursen b84440b857 MEDIA_ROOT -> STATIC_ROOT - apparently we don't really use MEDIA_ROOT at the moment since all files are handled not through file fields, but through explicit management of their paths
- Legacy-Id: 6980
2013-12-18 13:18:58 +00:00
Ole Laursen 2cefdd7410 Add WSGI application to settings to make it use the same application
definition as live (it probably doesn't matter at the moment though)
 - Legacy-Id: 6979
2013-12-18 13:06:39 +00:00
Ole Laursen ce3e6c59de ._meta.module_name -> ._meta.model_name
- Legacy-Id: 6978
2013-12-18 12:07:04 +00:00
Ole Laursen 896da07311 Disable XViewMiddleware, it has been moved in Django 1.6 and it's not
clear whether it's serving a useful purpose
 - Legacy-Id: 6977
2013-12-18 12:01:24 +00:00
Ole Laursen e348600bcb raw_post_data -> body
- Legacy-Id: 6976
2013-12-18 11:52:21 +00:00
Ole Laursen 1dc860236f Delete ADMIN_MEDIA_PREFIX which is now gone in Django, add a pattern to the static serving so a debug/test server serves the admin static files
- Legacy-Id: 6975
2013-12-18 11:45:36 +00:00
Ole Laursen 8c35b3e6da Fix the send SDO reminder admin template to not rely on adminmedia which is now gone, also fix up the formatting and add a title
- Legacy-Id: 6973
2013-12-18 11:18:24 +00:00
Ole Laursen 1df2a37a9f Remove dead admin templates from when there was an SDOs model
- Legacy-Id: 6972
2013-12-18 11:07:39 +00:00
Ole Laursen 8afd3fa5b7 Rewrite wg_menu tag to use simple_tag instead of a full template Node,
also fix a bug in the cache apparently not being filled in correctly
 - Legacy-Id: 6971
2013-12-18 10:25:59 +00:00
Ole Laursen e2e6c243a1 Remove the complicated tag processing from ballot_icon, instead just
decorate the function with @simple_tag(takes_context=True)
 - Legacy-Id: 6970
2013-12-18 10:22:30 +00:00
Ole Laursen 35520c8473 Enable clickjacking prevention middleware
- Legacy-Id: 6969
2013-12-18 10:14:47 +00:00
Ole Laursen 7f277a8fbb Replace user.get_profile() with user.person, the profile stuff is deprecated since Django 1.5
- Legacy-Id: 6968
2013-12-18 10:13:40 +00:00
Ole Laursen ea24f5c3bd Import slugify from django.utils.text (introduced in Django 1.5)
- Legacy-Id: 6967
2013-12-18 10:00:58 +00:00
Ole Laursen d1782297ab assertEquals -> assertEqual in tests, the former is deprecated
- Legacy-Id: 6964
2013-12-17 12:52:24 +00:00
Ole Laursen 42ade6273c Turn on CSRF protection - all forms must from now on have a {% csrf_token %}
- Legacy-Id: 6963
2013-12-17 12:50:24 +00:00
Ole Laursen 52a0825985 Take advantage of new include tag that can combine the include with a
"with foo=bar" instead of having separate "with" tags
 - Legacy-Id: 6962
2013-12-17 11:08:58 +00:00
Ole Laursen 36dd439027 Rewrite ifequal/endifequal template tags to if tags with ==/!=
- Legacy-Id: 6961
2013-12-17 10:42:34 +00:00
Ole Laursen d66ac15fc2 Rewrite a bunch of HttpResponseRedirect + url reverse calls to instead
take advantage of the redirect shortcut (introduced in Django 1.1)
 - Legacy-Id: 6960
2013-12-17 10:23:42 +00:00
Ole Laursen 72e36bde55 Don't output coverage data if there are test failures
- Legacy-Id: 6959
2013-12-17 10:08:12 +00:00
Ole Laursen 84a9f49053 mimetype -> content_type (mimetype is deprecated)
- Legacy-Id: 6945
2013-12-16 16:53:47 +00:00
Ole Laursen 85ab33533f Move feed redirect for feed_urls.py
- Legacy-Id: 6944
2013-12-16 16:35:07 +00:00
Ole Laursen e6b12350d2 Port IPR and liaisons feed setup to new feed API too
- Legacy-Id: 6943
2013-12-16 16:33:18 +00:00