The SIO2 project
  1. The SIO2 project
  2. SIO-1548

unit tests: add assertNumQueries to unit tests to avoid sql queries explosion

    Details

    • Type: Task Task
    • Status: New New
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Current Version
    • Component/s: OIOIOI
    • Labels:
      None

      Description

      It's quite easy to generate linear number of sql queries in django. It's hard to detect without a large database and django toolbar, so its usally detected during programming contests.

      To avoid such situation IMHO we should test number of sql queries in unit tests. Django supports it:

      https://docs.djangoproject.com/en/1.5/topics/testing/overview/#django.test.TestCase.assertNumQueries

      The task is to add such assertion to each unit test.

        Activity

        Show
        Michał Adamczyk added a comment - Read also: http://blog.isotoma.com/2014/05/a-different-view/

          People

          • Assignee:
            Unassigned
            Reporter:
            Michał Adamczyk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: