adamv avatar adamv committed 6c1867c

* Formatting changes to NULL doctests... (though now I'm thinking of converting them to unit tests.)

Comments (0)

Files changed (1)

tests/test_main/nulls/models.py

 
 class TableNullChar(BaseModel):
     """
-    >>> TableNullChar(val=None).save()
-    >>> TableNullChar(val="This is my string value.").save()
+    >>> for val in (None, "This is my string value."):
+    ...     TableNullChar(val=val).save()
     >>> len(list(TableNullChar.objects.all()))
     2
     """
     
 class TableNullText(BaseModel):
     """
-    >>> TableNullText(val=None).save()
-    >>> TableNullText(val="This is my string value.").save()
+    >>> for val in (None, "This is my string value."):
+    ...     TableNullText(val=val).save()
     >>> len(list(TableNullText.objects.all()))
     2
     """
 
 class TableNullInteger(BaseModel):
     """
-    >>> TableNullInteger(val=None).save()
-    >>> TableNullInteger(val=39482).save()
+    >>> for val in (None, 32768):
+    ...     TableNullInteger(val=val).save()
     >>> len(list(TableNullInteger.objects.all()))
     2
     """
 
 class TableNullDateTime(BaseModel):
     """
-    >>> TableNullDateTime(val=None).save()
-    >>> TableNullDateTime(val=datetime.datetime(2009,1,1,4,3,5)).save()
+    >>> for val in (None, datetime.datetime(2009,1,1,4,3,5)):
+    ...     TableNullDateTime(val=val).save()
     >>> len(list(TableNullDateTime.objects.all()))
     2
     """
 
 class TableNullDate(BaseModel):
     """
-    >>> TableNullDate(val=None).save()
-    >>> TableNullDate(val=datetime.date(2009,1,1)).save()
+    >>> for val in (None, datetime.date(2009,1,1)):
+    ...     TableNullDate(val=val).save()
     >>> len(list(TableNullDate.objects.all()))
     2
     """
 
 class TableNullBoolean(BaseModel):
     """
-    >>> TableNullBoolean(val=None).save()
-    >>> TableNullBoolean(val=True).save()
-    >>> TableNullBoolean(val=False).save()
+    >>> for val in (None, True, False):
+    ...     TableNullBoolean(val=val).save()
     >>> len(list(TableNullBoolean.objects.all()))
     3
     """
 
 class TableNullNullBoolean(BaseModel):
     """
-    >>> TableNullNullBoolean(val=None).save()
-    >>> TableNullNullBoolean(val=True).save()
-    >>> TableNullNullBoolean(val=False).save()
+    >>> for val in (None, True, False):
+    ...     TableNullNullBoolean(val=val).save()
     >>> len(list(TableNullNullBoolean.objects.all()))
     3
     """
 
 class TableNullDecimal(BaseModel):
     """
-    >>> TableNullDecimal(val=None).save()
-   
-    Try a value at the top end of the specified precision/scale
-    >>> TableNullDecimal(val=decimal.Decimal('99.99')).save()
-    
+    Try a value at the top end of the specified precision/scale.
+    >>> for val in (None, decimal.Decimal('99.99')):
+    ...     TableNullDecimal(val=val).save()
     >>> len(list(TableNullDecimal.objects.all()))
     2
     """
 
 class TableNullFloat(BaseModel):
     """
-    >>> TableNullFloat(val=None).save()
-    >>> TableNullFloat(val=34.3).save()
+    >>> for val in (None, 34.3):
+    ...     TableNullFloat(val=val).save()
     >>> len(list(TableNullFloat.objects.all()))
     2
     """
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.