This doesn't seem like a Jira ticket to me.  You are using code (apparently) in ways it wasn't meant to be used.  That's fine.  You have to fix that code so that it's appropriate.  That means removing the assertion that is now false, and verifying that it really is OK.  Someone clearly felt strongly that the xmodule_runtime would not be None, and now it is.