prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Importing a backup made by update_production.sh does not work flawlessly.
  Last week we wanted to do a production update. The json dump file created during that update could not be imported without issues:
  - The dump does not contain the cronjob user, but foreign key references to it. This can not be imported
  - The dump contains data included by django by default (auth, permission, ...). These need to be excluded when importing.
  
  There should be some kind of documentation on what needs to be executed to import this dump back into the database. We should also add some test (could probably just run on travis) that ensures this always works (dump, flush database, migrate, load dump).
  
  </issue>
  <code>
  [start of evap/evaluation/management/commands/dump_testdata.py]
  1 import os
  2 
  3 from django.conf import settings
  4 from django.core.management.base import BaseCommand
  5 from django.core.management import call_command
  6 
  7 
  8 class Command(BaseCommand):
  9     args = ''
  10     help = 'Dumps all relevant contents of the database into test_data.json.'
  11     requires_migrations_checks = True
  12 
  13     def handle(self, *args, **options):
  14         outfile_name = os.path.join(settings.BASE_DIR, "evaluation", "fixtures", "test_data.json")
  15         call_command("dumpdata", "auth.group", "evaluation", "rewards", "grades", indent=2, output=outfile_name)
  16
  [end of evap/evaluation/management/commands/dump_testdata.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/evap/evaluation/management/commands/dump_testdata.py b/evap/evaluation/management/commands/dump_testdata.py
  --- a/evap/evaluation/management/commands/dump_testdata.py
  +++ b/evap/evaluation/management/commands/dump_testdata.py
  @@ -12,4 +12,6 @@
   
       def handle(self, *args, **options):
           outfile_name = os.path.join(settings.BASE_DIR, "evaluation", "fixtures", "test_data.json")
  -        call_command("dumpdata", "auth.group", "evaluation", "rewards", "grades", indent=2, output=outfile_name)
  +        call_command(
  +            "dumpdata", "auth.group", "evaluation", "rewards", "grades", indent=2,
  +            output=outfile_name, natural_foreign=True, natural_primary=True)
  
verification_info: {"golden_diff": "diff --git a/evap/evaluation/management/commands/dump_testdata.py b/evap/evaluation/management/commands/dump_testdata.py\n--- a/evap/evaluation/management/commands/dump_testdata.py\n+++ b/evap/evaluation/management/commands/dump_testdata.py\n@@ -12,4 +12,6 @@\n \n     def handle(self, *args, **options):\n         outfile_name = os.path.join(settings.BASE_DIR, \"evaluation\", \"fixtures\", \"test_data.json\")\n-        call_command(\"dumpdata\", \"auth.group\", \"evaluation\", \"rewards\", \"grades\", indent=2, output=outfile_name)\n+        call_command(\n+            \"dumpdata\", \"auth.group\", \"evaluation\", \"rewards\", \"grades\", indent=2,\n+            output=outfile_name, natural_foreign=True, natural_primary=True)\n", "issue": "Importing a backup made by update_production.sh does not work flawlessly.\nLast week we wanted to do a production update. The json dump file created during that update could not be imported without issues:\r\n- The dump does not contain the cronjob user, but foreign key references to it. This can not be imported\r\n- The dump contains data included by django by default (auth, permission, ...). These need to be excluded when importing.\r\n\r\nThere should be some kind of documentation on what needs to be executed to import this dump back into the database. We should also add some test (could probably just run on travis) that ensures this always works (dump, flush database, migrate, load dump).\n", "before_files": [{"content": "import os\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.core.management import call_command\n\n\nclass Command(BaseCommand):\n    args = ''\n    help = 'Dumps all relevant contents of the database into test_data.json.'\n    requires_migrations_checks = True\n\n    def handle(self, *args, **options):\n        outfile_name = os.path.join(settings.BASE_DIR, \"evaluation\", \"fixtures\", \"test_data.json\")\n        call_command(\"dumpdata\", \"auth.group\", \"evaluation\", \"rewards\", \"grades\", indent=2, output=outfile_name)\n", "path": "evap/evaluation/management/commands/dump_testdata.py"}]}