~seif/zeitgeist/fix-false-payloads

« back to all changes in this revision

Viewing changes to test/engine-test.py

  • Committer: Siegfried-Angel Gevatter Pujals
  • Date: 2010-09-24 17:02:50 UTC
  • Revision ID: rainct@ubuntu.com-20100924170250-447qjm6w4l8vx894
Fix bug #641968: Querying for LeastRecentActor with event templates
doesn't work.

In the case of the LeastRecentActor sorting a JOIN is used. If we want
to impose conditions on which type of events/subjects are considered, this
must be done inside the JOINed query.

Show diffs side-by-side

added added

removed removed

Lines of Context:
627
627
                ids = self.engine.find_eventids(TimeRange.always(),
628
628
                        [template], StorageState.Any, 0, ResultType.LeastRecentActor)
629
629
                self.assertEquals(ids, [2])
 
630
                
 
631
                # Let's also try the same with MostRecentActor... Although there
 
632
                # should be no problem here.
 
633
                template = Event.new_for_values(subject_uri="home/boo")
 
634
                ids = self.engine.find_eventids(TimeRange.always(),
 
635
                        [template], StorageState.Any, 0, ResultType.LeastRecentActor)
 
636
                self.assertEquals(ids, [2])
630
637
        
631
638
        def testResultTypesMostPopularOrigin(self):
632
639
                import_events("test/data/twenty_events.js", self.engine)