To find all occurrences of a substring Python does not have any built-in string function that does what you're looking for, but you could use the more powerful regular expressions:
import re
string = "test test test test"
[m.start() for m in re.finditer('test', 'test test test test')]
To know more about this you can have a look at the following video:-