Ad
  • Custom User Avatar

    I want to continue this discussion.

    I also kept getting the same error:

        test.expect(default2 > now2 > default > now, msg)
    TypeError: '>' not supported between instances of 'NoneType' and 'datetime.datetime'
    

    And after expanding the further comments, it is revealed that the test contains:

    field2 = DateTimeField(auto_now=True, blank=True)
    default = field2.default
    

    This feels out of scope, since DateTimeField shouldn't be accessed outside a class. I had to put in extra hacks in my solution to get this to work.

  • Custom User Avatar

    I'm having troubles with this Kata, I don't have any prior experience with Django or Databases, but the error messages seem to be too vague for me. The message "First name (CharField) is None" doesn't tell me what is being tested, what would/should be correct or what is specifically wrong.

    I know that my implementation is wrong, since it doesn't pass the tests, but I can't find why or how, since it already supplies the Fields with their defaults, so they shouldn't be None.

  • Custom User Avatar

    My attempted solution passes all tests except for the last one (Random models), where it either fails or passes validation depending on the validation logic of my EmailField. Unfortunately, the test doesn't give any details on where exactly it fails and I have no clue what I should change. What exactly are the validation requirements for EmailField? For example, do min_length and max_length apply to the entire email string or separately to each of address, subdomain, domain?

    Edit: I found the bug in my solution and it had nothing to do with the EmailField but with validation of another field. Still, it's quite hard to debug the solution to this kata, because the user doesn't know what is tested for exaclty. Is that intended?