Ad
  • Custom User Avatar

    Iiiiiiiii po co plusik w wyrażeniu regularnym?;)

  • Custom User Avatar

    I've changed the name to "movies", because I was testing the solution on my machine and I had commit included in my solution. But so far as I remember even without con.commit() the data on the localhost was saved on each run of the program and I wasn't then clearing the database, but nevermind.

    One thing is pretty funny - how am I suposed to pass test 2 if the data is not sorted in any way. Proof:

    # Data.
    movies = [
        ('Rise of the Planet of the Apes', 2011, 77),  # id=1
        ('Dawn of the Planet of the Ape', 2014, 91),   # id=2 and so on.
        ('Alien', 1979, 97),
        ('Aliens', 1986, 98),
        ('Mad Max', 1979, 95),
        ('Mad Max 2: The Road Warrior', 1981, 100)
    ]
    
    set([
        (u'Mad Max', 1979, 95),
        (u'Dawn of the Planet of the Apes', 2014, 91),
        (u'Mad Max 2: The Road Warrior', 1981, 100),
        (u'Rise of the Planet of the Apes', 2011, 77),
        (u'Alien', 1979, 97),
        (u'Aliens', 1986, 98)])
    should equal set([
        (u'Mad Max', 1979, 95),
        (u'Mad Max 2: The Road Warrior', 1981, 100),
        (u'Rise of the Planet of the Apes', 2011, 77),
        (u'Alien', 1979, 97),
        (u'Aliens', 1986, 98),
        (u'Dawn of the Planet of the Ape', 2014, 91)
    ])
    

    BTW I think teaching people to name tables in databases in uppercase is bad habbit. ;)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    How am I supossed to pass this kata? Should I write my own test cases to pass it?