Commits

Gustavo Picon committed e20ba7c

Don't reassign local var.

Comments (0)

Files changed (1)

treebeard/tests/test_treebeard.py

 
 class TestMP_TreeFindProblems(TestTreeBase):
     def test_find_problems(self, mpalphabet_model):
-        model = mpalphabet_model
-        model.alphabet = '01234'
-        model(path='01', depth=1, numchild=0, numval=0).save()
-        model(path='1', depth=1, numchild=0, numval=0).save()
-        model(path='111', depth=1, numchild=0, numval=0).save()
-        model(path='abcd', depth=1, numchild=0, numval=0).save()
-        model(path='qa#$%!', depth=1, numchild=0, numval=0).save()
-        model(path='0201', depth=2, numchild=0, numval=0).save()
-        model(path='020201', depth=3, numchild=0, numval=0).save()
-        model(path='03', depth=1, numchild=2, numval=0).save()
-        model(path='0301', depth=2, numchild=0, numval=0).save()
-        model(path='030102', depth=3, numchild=10, numval=0).save()
-        model(path='04', depth=10, numchild=1, numval=0).save()
-        model(path='0401', depth=20, numchild=0, numval=0).save()
+        mpalphabet_model.alphabet = '01234'
+        mpalphabet_model(path='01', depth=1, numchild=0, numval=0).save()
+        mpalphabet_model(path='1', depth=1, numchild=0, numval=0).save()
+        mpalphabet_model(path='111', depth=1, numchild=0, numval=0).save()
+        mpalphabet_model(path='abcd', depth=1, numchild=0, numval=0).save()
+        mpalphabet_model(path='qa#$%!', depth=1, numchild=0, numval=0).save()
+        mpalphabet_model(path='0201', depth=2, numchild=0, numval=0).save()
+        mpalphabet_model(path='020201', depth=3, numchild=0, numval=0).save()
+        mpalphabet_model(path='03', depth=1, numchild=2, numval=0).save()
+        mpalphabet_model(path='0301', depth=2, numchild=0, numval=0).save()
+        mpalphabet_model(path='030102', depth=3, numchild=10, numval=0).save()
+        mpalphabet_model(path='04', depth=10, numchild=1, numval=0).save()
+        mpalphabet_model(path='0401', depth=20, numchild=0, numval=0).save()
 
         (evil_chars, bad_steplen, orphans, wrong_depth, wrong_numchild) = (
-            model.find_problems())
-        got = [o.path for o in model.objects.filter(id__in=evil_chars)]
+            mpalphabet_model.find_problems())
+        got = [o.path for o in mpalphabet_model.objects.filter(id__in=evil_chars)]
         assert ['abcd', 'qa#$%!'] == got
-        got = [o.path for o in model.objects.filter(id__in=bad_steplen)]
+        got = [o.path for o in mpalphabet_model.objects.filter(id__in=bad_steplen)]
         assert ['1', '111'] == got
-        got = [o.path for o in model.objects.filter(id__in=orphans)]
+        got = [o.path for o in mpalphabet_model.objects.filter(id__in=orphans)]
         assert ['0201', '020201'] == got
-        got = [o.path for o in model.objects.filter(id__in=wrong_numchild)]
+        got = [o.path for o in mpalphabet_model.objects.filter(id__in=wrong_numchild)]
         assert ['03', '0301', '030102'] == got
-        got = [o.path for o in model.objects.filter(id__in=wrong_depth)]
+        got = [o.path for o in mpalphabet_model.objects.filter(id__in=wrong_depth)]
         assert ['04', '0401'] == got
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.